How to get the ID or Serial Number of mainboard by using C#?

  • Thread starter Thread starter Jewlin Gu
  • Start date Start date
J

Jewlin Gu

I'd tried to get the ID or Serial Number of main-board
and hard-disk via WMI using C#, but failed.

One friend suggested me with some codes calling WIN32 API,
but only effective on WIN2000 or later.

How to get those data on Win98/ME/2000/XP by using C#?
 
You can use the Microsoft Scripting Runtime.

The Drives are in FileSystemObject, iterate through them do a comparison on
the DriveType and grab the SerrialNumber Property of the one you want.
 
Why use FileSystemObject when there is direct support in the Framework
Classe Library, take a look at the System.Management namespace classes,
these are wrapper arround WMI offering all OP is looking for.

Willy.
 
Back
Top