473,395 Members | 1,468 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Getting either harddrive or motherboard serial number

I have been trying to write a code that will give me the
serial number of a harddrive or that of a motherboard, but
i don't seem to get it right.
Do anybody out there have any idea?
Nov 15 '05 #1
2 16109
You need to use WMI check MSDN at this link:

http://msdn.microsoft.com/library/de...oarddevice.asp

using System.Management;

//Connection credentials to the remote computer - not needed if the logged
in account has access
ConnectionOptions oConn = new ConnectionOptions();
oConn.Username = "Administrator";
oConn.Password = "";

System.Management.ManagementScope oMs = new
System.Management.ManagementScope(\\MachineID, oConn);

System.Management.ObjectQuery oQuery = new
System.Management.ObjectQuery("select SerialNumber from Win32_BaseBoard");

ManagementObjectSearcher oSearcher = new
ManagementObjectSearcher(oMs,oQuery);

ManagementObjectCollection oReturnCollection = oSearcher.Get();

foreach( ManagementObject oReturn in oReturnCollection )
{
Console.WriteLine("Serial Number : " +
oReturn["SerialNumber"].ToString());
}

Hope this helps

Ian
"Abubakar" <xv************@yahoo.co.uk> wrote in message
news:01****************************@phx.gbl...
I have been trying to write a code that will give me the
serial number of a harddrive or that of a motherboard, but
i don't seem to get it right.
Do anybody out there have any idea?

Nov 15 '05 #2
I hope that this worked for you.

"Ian Frawley" wrote in message
You need to use WMI check MSDN at this link:

http://msdn.microsoft.com/library/de...oarddevice.asp
using System.Management;

//Connection credentials to the remote computer - not needed if the logged
in account has access
ConnectionOptions oConn = new ConnectionOptions();
oConn.Username = "Administrator";
oConn.Password = "";

System.Management.ManagementScope oMs = new
System.Management.ManagementScope(\\MachineID, oConn);

System.Management.ObjectQuery oQuery = new
System.Management.ObjectQuery("select SerialNumber from Win32_BaseBoard");

ManagementObjectSearcher oSearcher = new
ManagementObjectSearcher(oMs,oQuery);

ManagementObjectCollection oReturnCollection = oSearcher.Get();

foreach( ManagementObject oReturn in oReturnCollection )
{
Console.WriteLine("Serial Number : " +
oReturn["SerialNumber"].ToString());
}

Hope this helps

Ian
"Abubakar" <xv************@yahoo.co.uk> wrote in message
news:01****************************@phx.gbl...
I have been trying to write a code that will give me the
serial number of a harddrive or that of a motherboard, but
i don't seem to get it right.
Do anybody out there have any idea?


Nov 15 '05 #3

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

Similar topics

5
by: Claudio Grondi | last post by:
Background information: --------------------------------- in order to monitor mainboard sensory data as fan speeds, temperatures, applications like SpeedFan http://www.almico.com/speedfan.php or...
3
by: Evgeny Zoldin | last post by:
Hi ALL, how can I get serial number of harddrive using "pure" .NET, without Win API? Thanx
2
by: Job Lot | last post by:
How can I retrieve the Motherboard, hard drive, NIC Serial Number Using vb.net. thanx
3
by: Abubakar | last post by:
I have been trying to write a code that will enable me get the serial number of the motherboard or harddrive on a given system but no luck so far. Can any one out there help me.
15
by: Roberto Hernández | last post by:
I develop a software and I want to protect it whit some unique ID of a computer Can I get the serial ID of the motherboard?
0
by: mzaiady | last post by:
I need to know how to get the monitor, motherboard and other hardware information and serial number using C, i can do it with WMI in windows but it giveme just what installed and defalut, i need...
1
by: colemanj4 | last post by:
Hello, I have a table that shows: Serial Number Date Returned 2333005Y 8/15/2006 2333005Y 7/18/2003 2333005Y 1/1/2004 2333005Y 7/5/2006 2333005Y 11/24/2005 2333005Y 9/8/2005
4
by: Benjamins via AccessMonster.com | last post by:
Hi, I have used CreateObject("Scripting.FileSystemObject") to get the disk volume. Is there any other way of get the disk volume other than using the FSO. Thanks -- Message posted via...
2
AmberJain
by: AmberJain | last post by:
Hello, The question itself is quite explanatory. My current PC configuration consists of 256 MB RAM and I am planning to upgrade to 1 or 2 GB RAM. So how can I find the amount of RAM my...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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...
0
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,...
0
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...

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.