473,575 Members | 3,321 Online
Bytes | Software Development & Data Engineering Community
+ 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 16145
You need to use WMI check MSDN at this link:

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

using System.Manageme nt;

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

System.Manageme nt.ManagementSc ope oMs = new
System.Manageme nt.ManagementSc ope(\\MachineID , oConn);

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

ManagementObjec tSearcher oSearcher = new
ManagementObjec tSearcher(oMs,o Query);

ManagementObjec tCollection oReturnCollecti on = oSearcher.Get() ;

foreach( ManagementObjec t oReturn in oReturnCollecti on )
{
Console.WriteLi ne("Serial Number : " +
oReturn["SerialNumb er"].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.Manageme nt;

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

System.Manageme nt.ManagementSc ope oMs = new
System.Manageme nt.ManagementSc ope(\\MachineID , oConn);

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

ManagementObjec tSearcher oSearcher = new
ManagementObjec tSearcher(oMs,o Query);

ManagementObjec tCollection oReturnCollecti on = oSearcher.Get() ;

foreach( ManagementObjec t oReturn in oReturnCollecti on )
{
Console.WriteLi ne("Serial Number : " +
oReturn["SerialNumb er"].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
4426
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 MBM http://mbm.livewiredev.com/ can be used. Both of the mentioned apps expose data got from the hardware in a shared memory area.
3
1671
by: Evgeny Zoldin | last post by:
Hi ALL, how can I get serial number of harddrive using "pure" .NET, without Win API? Thanx
2
3565
by: Job Lot | last post by:
How can I retrieve the Motherboard, hard drive, NIC Serial Number Using vb.net. thanx
3
7708
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
14919
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
2487
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 to contaact directly with hardware and get those information very soon
1
1602
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
3136
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 AccessMonster.com http://www.accessmonster.com/Uwe/Forums.aspx/databases-ms-access/200801/1
2
6759
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 motherboard supports? I know searching google with motherboard number would have helped but I dont know how to find out motherboard information under Xubuntu...
0
7845
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8120
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8281
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7868
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8143
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6515
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5338
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3778
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2286
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.