473,786 Members | 2,334 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Harddrive or Motherboard Serial number

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.
Nov 20 '05 #1
3 7738
Hi,

Add a reference to system.manageme nt.dll.

Dim moReturn As Management.Mana gementObjectCol lection

Dim moSearch As Management.Mana gementObjectSea rcher

Dim mo As Management.Mana gementObject

moSearch = New Management.Mana gementObjectSea rcher("Select * from
Win32_LogicalDi sk'")

moReturn = moSearch.Get

For Each mo In moReturn

Dim VolumeName As String = mo("Volumename" )

Dim SerialNumber As String = mo("Volumeseria lnumber")

Dim strOut As String = String.Format(" {0} - {1}", VolumeName, SerialNumber)

Debug.WriteLine (strOut)

Next

moSearch = New Management.Mana gementObjectSea rcher("Select * from
Win32_Processor ")

moReturn = moSearch.Get

For Each mo In moReturn

Debug.WriteLine (mo("ProcessorI D"))

Next

Ken

----------------

"Abubakar" <xv************ @yahoo.co.uk> wrote in message
news:01******** *************** *****@phx.gbl.. .
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.

Nov 20 '05 #2
* "Abubakar" <xv************ @yahoo.co.uk> scripsit:
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.


Harddisk volume number:

Add a reference to "System.Managem ent.dll", then import the namespace
'System.Managem ent' and use this code to get info about the volume
(including the serial number):

\\\
Dim disk As New ManagementObjec t( _
"Win32_LogicalD isk.DeviceID="" C:""" _
)
Dim diskProperty As PropertyData
For Each diskProperty In disk.Properties
Console.WriteLi ne( _
"{0} = {1}", _
diskProperty.Na me, _
diskProperty.Va lue _
)
Next diskProperty
///

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #3
Addendum:

If you want to use WMI, have a look at the classes 'Win32_DiskDriv e' and
'Win32_BaseBoar d'.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #4

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

Similar topics

15
9692
by: tom | last post by:
Hi, How do I get the serial number of the harddisk in .NET? I want this to be the same number even if the user has reformatted, so I do not want the volume serial number. Thanx, t
3
1692
by: Evgeny Zoldin | last post by:
Hi ALL, how can I get serial number of harddrive using "pure" .NET, without Win API? Thanx
5
2693
by: | last post by:
Hi, Do memory sticks have serial numbers like harddrives? If so how can I get this, I want to uniquely identify a memory stick (removable drive) for authentication. Thanks
2
3578
by: Job Lot | last post by:
How can I retrieve the Motherboard, hard drive, NIC Serial Number Using vb.net. thanx
2
16169
by: Abubakar | last post by:
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?
3
4826
by: bayazee | last post by:
Hi, How can I get CPU Serial number , or motherboard serial number with C . I need an idetification of a computer .... ThanX --------------------------------------------------- iranian python community --www.python.ir
4
6872
by: PBI | last post by:
I would like to know if it is possible to read, through php, the Hard Disk Serial Number or other serial number (cpu, motherboard etc... ). Thanks.
0
4908
Airslash
by: Airslash | last post by:
Hello, I've written a class that resembles a hard drive. I'm already able using the Windows API to get information such as the remaining free bytes, the sectors and clusters,a nd it all works fine. The last step that I need is to obtain the serial number of the harddrive in question. From what I can understand in the MSDN library you need to take into account that a Volume can span multiple disks etc, but I don't wanne waste time on that...
0
9647
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9959
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8988
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7510
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6744
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5397
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5532
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4063
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
2
3668
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.