How can I Get my Port ID
Hardware & Devices
2
Posts
2
Posters
0
Views
1
Watching
-
ManagementObjectSearcher searcher = new ManagementObjectSearcher("Select * from WIN32_SerialPort"); foreach(ManagementObject Port in searcher.Get()) { // use the Port object to get the values you need... Console.Write(Port.GetPropertyValue("Name")); }
you need a using and a reference to System.Management. -- modified at 10:40 Wednesday 4th April, 2007 I'm sorry, this of course, is only C# code, if this isn't what you were looking for,.. well then specify :p
Visual Studio can't evaluate this, can you?
public object moo { __get { return moo; } __set { moo = value; } }