I am able to get the list of network printers via this code:
private void Form1_Load(object sender, EventArgs e)
{
foreach (String printer in PrinterSettings.InstalledPrinters)
{
listBox1.Items.Add(printer.ToString());
}
}
For each network printer, I want to extract out more information like: (a) get document information, like number of pages printed, filename, file-size, etc.
(b) get computer IP address from which document was printed.
(c) get username of who printed the document.
How do I achieve the above? any code samples would be appreciated. Do I have to look into Windows Management Instrumentation(WMI) stuffs?
You might be able to get out some of the information via WMI:
http://msdn.microsoft.com/en-us/library/Aa394363
If you want more information, and your printers support it, you might be able to use SNMP, here's an article\library that might help you find out how to use that:
http://www.codeproject.com/KB/cs/SNMPDLL.aspx
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With