473,503 Members | 2,126 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Finding/Listing usb/bluetooth/... serial-ports with System.Management.dll[reposted from microsoft.public.dotnet.framework.sdk, microsoft.public.dotnet.framework.wmi]


Having posted in microsoft.public.dotnet.framework.sdk and
microsoft.public.dotnet.framework.wmi without receiving any response, I
posthere on the off-chance that someone who isn't following those groups
knows a solution.

I'm using code (roughly like):

using System;
using System.Management;
public class Foo {
public static void Main() {
foreach ( ManagementObject port
in new ManagementClass("Win32_SerialPort").GetInstances() )
Console.WriteLine("{0}: {1}", port["deviceid"], port["name"]);
}
}

To query for the serial ports present on a system.

Unfortunatly, this doesn't seem to include COM-ports available via
usb-adapters or bluetooth. These devices are visible in the
DeviceManager in System->Hardware->DeviceManager->Ports (COM & LPT), and
I want to get the same list as that, just without the LPT ports.

What am I doing wrong?

I had trouble finding info on the web, so here's something for the
search engines to catch on for the benefit of the next guy.

Keywords: com, com-port, serial-port, WMI, System.Management, .NET, C#,
enumerating, listing, finding, searching, win32, windows, win32api)

--
Helge Jensen
mailto:he**********@slog.dk
sip:he**********@slog.dk
-=> Sebastian cover-music: http://ungdomshus.nu <=-
Jul 22 '05 #1
0 2256

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
3167
by: Jean-Sébastien Guay | last post by:
Hello, I'm pretty new to Python, though I have a fair bit of experience with C/C++, Java, Perl, PHP and others. I installed Tim Golden's wmi module...
1
2856
by: Alvin Lau | last post by:
It is possible to write a bluetooth application software by C# in Pocket PC ? If it is possible , where can i find the reference or sample? ThX ~ *** Sent via Developersdex...
1
9378
by: Srinivas | last post by:
Hi, I am working on a project to script all database objects.The code below works fine on my machine( windows XP ) and all the creates all the db objects. But I get an error message when I run...
10
2744
by: Wolfgang Kaml | last post by:
Hello All, I have been working on this for almost a week now and I haven't anything up my sleeves anymore that I could test in addition or change.... Since I am not sure, if this is a Windows...
8
1567
by: Vaughn | last post by:
I'm looking for a reliable Web Hoster that has full Dot Net functionality.I'm basically looking for something that's about $10/month or less, has ASP.Net support, and has positive feedback and...
3
9626
by: Yavuz Bogazci | last post by:
Hi, how can i get the serial number and the model number of a monitor via WMI? thanks yavuz bogazci
1
7793
by: henrycortezwu | last post by:
Hi All, I'd like to transfer files from a Desktop computer to my Cellphone/PDA using VB.NET I've research a bit on this, and I found that I would need to do it using OBEX via Serial Bluetooth...
0
1552
by: AbdullahWMGhaleb | last post by:
--Dear All, Using WMI, I managed to get information about device ID and manufacturer of my USB Bluetooth adapter. However, I CANNOT GET Blueooth Device Screen Name !...
4
3050
by: Logan | last post by:
I am interested in programmatically connecting my computer to my cell phone's bluetooth Hands-Free Profile (HFP). So can can use my computer to answer and make calls as well as route the audio...
3
7144
by: MarkTingson | last post by:
Hello Scripters, I have a project that needs to connect with a bluetooth device. My bluetooth is connected to my USB Port..Is it possible to use MSCOMM control to access my bluetooth?. ...
0
7205
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7353
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
5596
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5023
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4689
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3170
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1521
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
747
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
401
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.