473,772 Members | 2,965 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Finding/Listing usb/bluetooth/... serial-ports with System.Manageme nt.dll[reposted from microsoft.publi c.dotnet.framew ork.sdk, microsoft.publi c.dotnet.framew ork.wmi]


Having posted in microsoft.publi c.dotnet.framew ork.sdk and
microsoft.publi c.dotnet.framew ork.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.Manageme nt;
public class Foo {
public static void Main() {
foreach ( ManagementObjec t port
in new ManagementClass ("Win32_SerialP ort").GetInstan ces() )
Console.WriteLi ne("{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->DeviceManage r->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.Manageme nt, .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 2285

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

Similar topics

5
3184
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 (http://tgolden.sc.sabren.com/python/wmi.html), in the hopes it would help me list and work with services on my Win32 machine. Now, everything seems fine except for one thing : Listing services!
1
2863
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 http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it!
1
9398
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 it on a server( windows server 2003). The first part of the code where I am executing sp_dboption and getting all the options set for the database is working fine and it
10
2771
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 2003 Server or ADO or ODBC issue, I am posting this on all of the three newsgroups. That's the setup: Windows 2003 Server with IIS and ASP.NET actiavted Access 2002 mdb file (and yes, proper rights are set on TMP paths and path,
8
1581
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 reviews. It should also have some type of DB support (preferably SQL Server although most charge additional for it). Since I'm an independent software developer with a limited budget, in the near future I want to use the site as a way to display my...
3
9651
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
7825
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 COM Port. I've read that using OpenNetCF Serial component will make things easier coding things up because as of the moment there is no Serial Component on the .NET Framework.
0
1577
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 ! ------------------------------------------------------------------------ (I tried with many diffrent WMI classes by the follwing code foreach(ManagementObject mo in new ManagementClass("Win32_PNPDevice").GetInstances()) {
4
3065
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 through my computer headset. I have found a lot of information on the profiles themselves, what I haven't found anything on is how to connect to a bluetooth profile. My Cellphone is running MS Mobile 5.0 and my bluetooth dongle is a ZoNet model:...
3
7167
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?. Actually, I am currently using an ActiveX named BlueTooth FrameWork which I downloaded a few days ago. The ActiveX works fine but I need to use MSCOMM for it is a requirement for my project. Another thing is when I run my project, an ActiveX Bluetooth...
0
9620
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10261
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10104
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9912
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4007
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 we have to send another system
2
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2850
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.