If you open and create a .Net project (I recommend trying this with a
console application), then go to 'View' and select 'Server Explorer' from
the menu you should get the 'Server Explorer' appearing inside visual studio
(on the left usually),.
Expand the drop down list for 'Servers' and you should see a list of 7 child
nodes, these will include 'Management Classes' & 'Management Events'.
If you expand the 'Management Classes' you should see alot of nodes relating
to the machine hardware.
If you right click on the 'Printers' node and select 'Generate Managed
Class' it will generate a managed class in your project usually called
'Win32_Printer.cs' and from this class you will be able to get access to
printer information.
For example to get all the printer names on the network
using System;
using ConsoleApplication1.ROOT.CIMV2;
namespace ConsoleApplication1
{
class Class1
{
[STAThread]
static void Main(string[] args)
{
Printer.PrinterCollection printers = Printer.GetInstances();
foreach(Printer printer in printers)
{
Console.WriteLine(printer.Name);
}
Console.ReadLine();
}
}
}
HTH
Ollie Riches