Solved

Printer Ports

Posted on 2003-11-09
5
270 Views
Last Modified: 2010-04-16
Just wondering how i can retrieve the port of the printer that i have selected from the PrintDialog
0
Comment
Question by:_versamps_
  • 2
5 Comments
 

Expert Comment

by:WVW
ID: 9763007
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
0
 

Author Comment

by:_versamps_
ID: 10519968
string sPath = "Win32_Printer.DeviceID='" + <printer name> + "'";
ManagementPath path = new ManagementPath(sPath);
ManagementObject ob = new ManagementObject (path);
string sPort = ob["PortName"].ToString ();
0
 

Author Comment

by:_versamps_
ID: 10519972
asked this question a while back but i figured it out .. this is the method in case u need it also
0
 

Accepted Solution

by:
ee_ai_construct earned 0 total points
ID: 11747192
PAQed, with points refunded (200)
ee_ai_construct - CS Mod
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question