Click here to Skip to main content
14,663,743 members
Home » Discussions » C#
   

C#

 
AnswerRe: How can I find out what "USB Serial Device" is called in all other languages? Pin
Dave Kreskowiak30-Jun-20 11:18
mveDave Kreskowiak30-Jun-20 11:18 
GeneralRe: How can I find out what "USB Serial Device" is called in all other languages? Pin
arnold_w30-Jun-20 11:36
Memberarnold_w30-Jun-20 11:36 
GeneralRe: How can I find out what "USB Serial Device" is called in all other languages? Pin
Dave Kreskowiak30-Jun-20 11:59
mveDave Kreskowiak30-Jun-20 11:59 
GeneralRe: How can I find out what "USB Serial Device" is called in all other languages? Pin
Luc Pattyn30-Jun-20 11:48
sitebuilderLuc Pattyn30-Jun-20 11:48 
GeneralRe: How can I find out what "USB Serial Device" is called in all other languages? Pin
Dave Kreskowiak30-Jun-20 11:59
mveDave Kreskowiak30-Jun-20 11:59 
AnswerRe: How can I find out what "USB Serial Device" is called in all other languages? Pin
Luc Pattyn30-Jun-20 12:35
sitebuilderLuc Pattyn30-Jun-20 12:35 
GeneralRe: How can I find out what "USB Serial Device" is called in all other languages? Pin
arnold_w30-Jun-20 19:52
Memberarnold_w30-Jun-20 19:52 
GeneralRe: How can I find out what "USB Serial Device" is called in all other languages? Pin
Member 79891221-Jul-20 0:09
MemberMember 79891221-Jul-20 0:09 
Could you pick the information you need from WMI?

When I open \\.\ROOT\CIMV2 class Win32_SerialPort, I see one COM1 instance, which has 47 properties (some of which are empty values), like Availability, Caption, Name, ... ProviderType, ...

Maybe you have what you need (and then some!) there. As I do not have a USB COM-port at the moment, I can't tell what it wouold look like in WMI, but try it out!

If you haven't got a WMI browser: One that is reasonable OK to use is CodePlex Archive WMI Explorer[^]. Once you have found what you are looking for, setting up a search in C# code is fairly simple. Like this I use to get information on disk partitions:
ManagementScope scope = new ManagementScope(@"\\.\root\microsoft\windows\storage");

using (ManagementObjectSearcher searcher = new ManagementObjectSearcher("SELECT * FROM MSFT_Partition")) {
  scope.Connect();
  searcher.Scope = scope;

  foreach (ManagementObject queryObj in searcher.Get()) {
    char driveletter = (char)queryObj["DriveLetter"];
    if (driveletter == '\0') continue;
    FsVolume part = new FsVolume();
    part.driveletter = driveletter;
    part.diskNumber = (uint) queryObj["DiskNumber"];
    part.partNo =  (uint) queryObj["PartitionNumber"];
    part.partGuid = (string)queryObj["UniqueID"];
    partList.Add(part);
  }
}
Your code will obviously address other classes and properties - you'll find them using WMI Explorer (or some other WMI browser).

This won't give you "USB Serial Device" in all the languages of the world, but I assume that if you find the information you need by inspecting properties from WMI, it doesn't really matter what a rose is called in the current language.
GeneralRe: How can I find out what "USB Serial Device" is called in all other languages? Pin
arnold_w1-Jul-20 0:15
Memberarnold_w1-Jul-20 0:15 
GeneralRe: How can I find out what "USB Serial Device" is called in all other languages? Pin
Luc Pattyn1-Jul-20 1:08
sitebuilderLuc Pattyn1-Jul-20 1:08 
GeneralRe: How can I find out what "USB Serial Device" is called in all other languages? Pin
arnold_w1-Jul-20 1:58
Memberarnold_w1-Jul-20 1:58 
GeneralRe: How can I find out what "USB Serial Device" is called in all other languages? Pin
Luc Pattyn1-Jul-20 2:08
sitebuilderLuc Pattyn1-Jul-20 2:08 
GeneralRe: How can I find out what "USB Serial Device" is called in all other languages? Pin
arnold_w1-Jul-20 2:12
Memberarnold_w1-Jul-20 2:12 
QuestionVS2017 publish project to .exe without manifest files Pin
Member 1487747430-Jun-20 10:35
MemberMember 1487747430-Jun-20 10:35 
AnswerRe: VS2017 publish project to .exe without manifest files Pin
Dave Kreskowiak30-Jun-20 11:15
mveDave Kreskowiak30-Jun-20 11:15 
QuestionOptimize Linq To SQL Query Pin
Kevin Marois30-Jun-20 8:21
professionalKevin Marois30-Jun-20 8:21 
QuestionC# Pin
Member 1258896327-Jun-20 5:30
MemberMember 1258896327-Jun-20 5:30 
AnswerRe: C# Generate a password dictionary to log into API Pin
OriginalGriff27-Jun-20 5:49
mveOriginalGriff27-Jun-20 5:49 
GeneralRe: C# Generate a password dictionary to log into API Pin
Member 1258896327-Jun-20 5:59
MemberMember 1258896327-Jun-20 5:59 
GeneralRe: C# Generate a password dictionary to log into API Pin
OriginalGriff27-Jun-20 6:00
mveOriginalGriff27-Jun-20 6:00 
GeneralRe: C# Generate a password dictionary to log into API Pin
Dave Kreskowiak27-Jun-20 7:10
mveDave Kreskowiak27-Jun-20 7:10 
QuestionBest way to transform list and get top result from custom sort order? Pin
linalinea26-Jun-20 9:44
Memberlinalinea26-Jun-20 9:44 
AnswerRe: Best way to transform list and get top result from custom sort order? Pin
OriginalGriff26-Jun-20 11:28
mveOriginalGriff26-Jun-20 11:28 
GeneralRe: Best way to transform list and get top result from custom sort order? Pin
Richard Deeming29-Jun-20 0:21
mveRichard Deeming29-Jun-20 0:21 
AnswerRe: Best way to transform list and get top result from custom sort order? Pin
jsc4229-Jun-20 5:51
professionaljsc4229-Jun-20 5:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.