Csharp/C Sharp by API/System.Management/ManagementObjectSearcher
Версия от 15:31, 26 мая 2010; (обсуждение)
new ManagementObjectSearcher
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"]);
}
}
}
}
}