Link to home
Start Free TrialLog in
Avatar of _versamps_
_versamps_

asked on

Printer Ports

Just wondering how i can retrieve the port of the printer that i have selected from the PrintDialog
Avatar of WVW
WVW

I would also like to know this, Msdn has a wealth of information but i cant find anything to do with the status of a printer
Avatar of _versamps_

ASKER

string sPath = "Win32_Printer.DeviceID='" + <printer name> + "'";
ManagementPath path = new ManagementPath(sPath);
ManagementObject ob = new ManagementObject (path);
string sPort = ob["PortName"].ToString ();
asked this question a while back but i figured it out .. this is the method in case u need it also
ASKER CERTIFIED SOLUTION
Avatar of ee_ai_construct
ee_ai_construct
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial