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

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#?
 
S

some guy with a computer

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.
 
W

Willy Denoyette [MVP]

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top