-
September 2nd, 2013, 11:10 PM
#1
How do you populate a listbox with all available LPT,Com and USB ports?
Hi gang,
How do you populate a listbox with all available LPT,Com and USB ports?
I'd like to use a Form, and on form load, collect all LPT, Serial and USB ports on the current system and have them populate a listBox on the form.
Has anyone got a snippet?
SteveyD
-
September 6th, 2013, 03:45 PM
#2
Re: How do you populate a listbox with all available LPT,Com and USB ports?
-
September 18th, 2013, 08:29 PM
#3
Re: How do you populate a listbox with all available LPT,Com and USB ports?
I don't do much work with LPT or USB, but for Com I use:
Code:
string[] PortList = SerialPort.GetPortNames();
foreach (string p in PortList)
{
this.PortCB.Items.Add(p);
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|