I have used the Management class for the first time now and I find it very interesting.
First you have to add a reference System.Managemnt to the project.
- using System.Management;
- ManagementScope mgmtscope=new ManagementScope(@"\root\cimv2");
- mgmtscope.Connect();
- ManagementObjectSearcher objsearcher=new ManagementObjectSearcher("Select * from Win32_Printer");
- foreach(ManagementObject printer in objsearcher.Get())
- {
- if(printer["WorkOffline"].ToString().Equals("true"))
- {
- printername=printer["Name"].ToString();
- MessageBox.Show(printername+"-Offline");
- }
- }
Hope you have enjoyed this article.

Farrukh MunirPosted Feb 26, 2013, 6:00 AM
Thanks for the great solution, i am having a problem that the printer status of a network printer only updates when I refresh it manually from control panel , i am using windows 7