473,480 Members | 4,985 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 16124
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
4404
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
1652
by: Evgeny Zoldin | last post by:
Hi ALL, how can I get serial number of harddrive using "pure" .NET, without Win API? Thanx
2
3552
by: Job Lot | last post by:
How can I retrieve the Motherboard, hard drive, NIC Serial Number Using vb.net. thanx
3
7688
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
14901
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
2479
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
1593
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
3130
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
6749
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
7040
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
6905
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
7080
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...
0
6908
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...
1
4772
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4478
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
2980
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
561
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
178
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...

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.