I need to enumerate the available serial ports. I'm using c#. Anyone know how
cheers,
gareth
I need to enumerate the available serial ports. I'm using c#. Anyone know how
cheers,
gareth
try this:
string[] theSerialPortNames = System.IO.Ports.SerialPort.GetPortNames();
that should return you a list of valid serial ports
ahmedilyas wrote:
try this:
string[] theSerialPortNames = System.IO.Ports.SerialPort.GetPortNames();
that should return you a list of valid serial ports
ahmedilyas wrote:
try this:
string[] theSerialPortNames = System.IO.Ports.SerialPort.GetPortNames();
that should return you a list of valid serial ports
ahmedilyas wrote:
try this:
string[] theSerialPortNames = System.IO.Ports.SerialPort.GetPortNames();
that should return you a list of valid serial ports
How about setting the Port.For example a printer to a COM1 or LPT1 or COM2 ...etc. vise versa.
Can C# be able to assign Port programmatically
An example is on your WinXP when you :
1. click Start and click Printer and faxes.
2. Right click any of the printer installed in your local machine and click Properties.
3. It will show "<Your Local Machine Printer name> Properties."
4. Click on the Ports tab and there it will show the following port(s) or the enumerated ports.
5. If I check or choose any of the Port e.g. COM1, COM2 ..etc ... LPT1, LPT2.. etc.. .. FILE:, USB ..etc .etc
QUESTION: Can C# do this programmatically Is there any windows API to programmatically select or put a check mark on the Printer Port selected. Of course alot of the forums as showing the EnumPorts
[DllImport("winspool.drv", EntryPoint = "EnumPorts")]
public static extern int EnumPortsA(string pName, int Level, int lpbPorts, int cbBuf, ref int pcbNeeded, ref int pcReturned);But this does not help me solve my issue.
Thank you for hearing me out. Hope anyone can share their coding experience regarding this issue.
you may email or send me a reply : janverge@gmail.com