Use ManagementObjectSearcher to query Win32_PrintJob : ManagementObjectSearcher : Windows C# Source Code


Custom Search

C# Source Code » Windows » ManagementObjectSearcher »

 

Use ManagementObjectSearcher to query Win32_PrintJob








    


using System;
using System.Management;
public class MainClass {
    public static void Main() {
        string query = "SELECT * FROM Win32_PrintJob";
        using (ManagementObjectSearcher jobQuery = new ManagementObjectSearcher(query)) {
            using (ManagementObjectCollection jobs = jobQuery.Get()) {
                foreach (ManagementObject job in jobs) {
                    Console.WriteLine(job["JobID"]);
                }
            }
        }
    }
}

           
       
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Windows
» ManagementObjectSearcher