I have printer in my network to which I get by ip. I use OLEPRNLib library to get it status and it works ok.
I try to get job queue with this but it won't works:
System.Management.ObjectQuery oq = new System.Management.ObjectQuery("SELECT * FROM Win32_PrintJob");
ManagementObjectSearcher query1 = new ManagementObjectSearcher(oq);
ManagementObjectCollection queryCollection1 = query1.Get();
if (queryCollection1.Count == 0)
{
this.listBox1.Items.Add("Nie ma jobów");
}
foreach (ManagementObject prntJob in queryCollection1)
{
String jobName = prntJob.Properties["Name"].Value.ToString();
}
How can I get that jobs queue from printer by ip adress?