473,466 Members | 1,388 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Retrieving a system serial number...

Does anyone know how to retrieve the system serial number? I'm writing an
auditing program and need to grab that little bit of info.

Thanks!
Nov 21 '05 #1
10 14929
Maybe you can use the serialnumber from the next api-call:
Private Declare Function GetVolumeInformation Lib "Kernel32" Alias
"GetVolumeInformationA" (ByVal lpRootPathName As String, ByVal
lpVolumeNameBuffer As String, ByVal nVolumeNameSize As Long,
lpVolumeSerialNumber As Long, lpMaximumComponentLength As Long,
lpFileSystemFlags As Long, ByVal lpFileSystemNameBuffer As String, ByVal
nFileSystemNameSize As Long) As Long

"Terry Olsen" <to******@hotmail.com> wrote in message
news:Oa**************@TK2MSFTNGP11.phx.gbl...
Does anyone know how to retrieve the system serial number? I'm writing an
auditing program and need to grab that little bit of info.

Thanks!

Nov 21 '05 #2
Terry,

There is not a real serial number, there is sometimes a processor number and
with a computer connected to a LAN or whatever that uses a network adapter,
a Mac address, and probably more numbers, however as far as I have seen not
an always existing unique one.

You can find those starting reading here reading (after that a is a little
sample in this message).

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

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

It are a lot of collections in collections.

I have not at the moment a sample at hand for those numbers, however see
this sample how to get drive information. I do not know where I got it
anymore.

\\\Add a reference to "System.Management.dll".
Dim disk As New ManagementObject( _
"Win32_LogicalDisk.DeviceID=""C:""" )
Dim diskProperty As PropertyData
For Each diskProperty In disk.Properties
Console.WriteLine( _
"{0} = {1}", _
diskProperty.Name,
diskProperty.Value )
Next diskProperty
///

I hope this helps?

Cor


"Terry Olsen" <to******@hotmail.com> schreef in bericht
news:Oa**************@TK2MSFTNGP11.phx.gbl...
Does anyone know how to retrieve the system serial number? I'm writing an
auditing program and need to grab that little bit of info.

Thanks!

Nov 21 '05 #3
Maybe you can use the serialnumber from the next api-call:
Private Declare Function GetVolumeInformation Lib "Kernel32" Alias
"GetVolumeInformationA" (ByVal lpRootPathName As String, ByVal
lpVolumeNameBuffer As String, ByVal nVolumeNameSize As Long,
lpVolumeSerialNumber As Long, lpMaximumComponentLength As Long,
lpFileSystemFlags As Long, ByVal lpFileSystemNameBuffer As String, ByVal
nFileSystemNameSize As Long) As Long

"Terry Olsen" <to******@hotmail.com> wrote in message
news:Oa**************@TK2MSFTNGP11.phx.gbl...
Does anyone know how to retrieve the system serial number? I'm writing an
auditing program and need to grab that little bit of info.

Thanks!

Nov 21 '05 #4
Hi,

Windows serial number

Dim myReg As RegistryKey = Registry.LocalMachine

Dim MyRegKey As RegistryKey

Dim MyVal As String

MyRegKey = myReg.OpenSubKey("Software\Microsoft\Windows NT\CurrentVersion")

MyVal = MyRegKey.GetValue("ProductID")

MyRegKey.Close()

Ken

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

"Terry Olsen" <to******@hotmail.com> wrote in message
news:Oa**************@TK2MSFTNGP11.phx.gbl...
Does anyone know how to retrieve the system serial number? I'm writing an
auditing program and need to grab that little bit of info.

Thanks!

Nov 21 '05 #5
Hi,

Windows serial number

Dim myReg As RegistryKey = Registry.LocalMachine

Dim MyRegKey As RegistryKey

Dim MyVal As String

MyRegKey = myReg.OpenSubKey("Software\Microsoft\Windows NT\CurrentVersion")

MyVal = MyRegKey.GetValue("ProductID")

MyRegKey.Close()

Ken

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

"Terry Olsen" <to******@hotmail.com> wrote in message
news:Oa**************@TK2MSFTNGP11.phx.gbl...
Does anyone know how to retrieve the system serial number? I'm writing an
auditing program and need to grab that little bit of info.

Thanks!

Nov 21 '05 #6
We use HP/Compaq & IBM machines. Belarc Advisor is able to show the system
serial number of these machines (matches the serial number the vendor puts
on the nameplate). That's what I'm wanting to figure out how to grab...
"Cor Ligthert" <no************@planet.nl> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Terry,

There is not a real serial number, there is sometimes a processor number
and with a computer connected to a LAN or whatever that uses a network
adapter, a Mac address, and probably more numbers, however as far as I
have seen not an always existing unique one.

You can find those starting reading here reading (after that a is a
little sample in this message).

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

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

It are a lot of collections in collections.

I have not at the moment a sample at hand for those numbers, however see
this sample how to get drive information. I do not know where I got it
anymore.

\\\Add a reference to "System.Management.dll".
Dim disk As New ManagementObject( _
"Win32_LogicalDisk.DeviceID=""C:""" )
Dim diskProperty As PropertyData
For Each diskProperty In disk.Properties
Console.WriteLine( _
"{0} = {1}", _
diskProperty.Name,
diskProperty.Value )
Next diskProperty
///

I hope this helps?

Cor


"Terry Olsen" <to******@hotmail.com> schreef in bericht
news:Oa**************@TK2MSFTNGP11.phx.gbl...
Does anyone know how to retrieve the system serial number? I'm writing
an auditing program and need to grab that little bit of info.

Thanks!


Nov 21 '05 #7
We use HP/Compaq & IBM machines. Belarc Advisor is able to show the system
serial number of these machines (matches the serial number the vendor puts
on the nameplate). That's what I'm wanting to figure out how to grab...
"Cor Ligthert" <no************@planet.nl> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Terry,

There is not a real serial number, there is sometimes a processor number
and with a computer connected to a LAN or whatever that uses a network
adapter, a Mac address, and probably more numbers, however as far as I
have seen not an always existing unique one.

You can find those starting reading here reading (after that a is a
little sample in this message).

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

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

It are a lot of collections in collections.

I have not at the moment a sample at hand for those numbers, however see
this sample how to get drive information. I do not know where I got it
anymore.

\\\Add a reference to "System.Management.dll".
Dim disk As New ManagementObject( _
"Win32_LogicalDisk.DeviceID=""C:""" )
Dim diskProperty As PropertyData
For Each diskProperty In disk.Properties
Console.WriteLine( _
"{0} = {1}", _
diskProperty.Name,
diskProperty.Value )
Next diskProperty
///

I hope this helps?

Cor


"Terry Olsen" <to******@hotmail.com> schreef in bericht
news:Oa**************@TK2MSFTNGP11.phx.gbl...
Does anyone know how to retrieve the system serial number? I'm writing
an auditing program and need to grab that little bit of info.

Thanks!


Nov 21 '05 #8
Terry,

I almost forgot to answer you, using the links I showed you and the code
you can use boards, baseboard, serialnumber, than you get the serialnumer of
the baseboard, I do not know if that is the number what is as well what is
at the back of your computers. However the information you can get is so
immense, it is impossible to tell you what it is what without trying.

I hope this helps?

Cor

"Terry Olsen" <to******@hotmail.com> ..
We use HP/Compaq & IBM machines. Belarc Advisor is able to show the
system serial number of these machines (matches the serial number the
vendor puts on the nameplate). That's what I'm wanting to figure out how
to grab...
"Cor Ligthert" <no************@planet.nl> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Terry,

There is not a real serial number, there is sometimes a processor number
and with a computer connected to a LAN or whatever that uses a network
adapter, a Mac address, and probably more numbers, however as far as I
have seen not an always existing unique one.

You can find those starting reading here reading (after that a is a
little sample in this message).

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

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

It are a lot of collections in collections.

I have not at the moment a sample at hand for those numbers, however see
this sample how to get drive information. I do not know where I got it
anymore.

\\\Add a reference to "System.Management.dll".
Dim disk As New ManagementObject( _
"Win32_LogicalDisk.DeviceID=""C:""" )
Dim diskProperty As PropertyData
For Each diskProperty In disk.Properties
Console.WriteLine( _
"{0} = {1}", _
diskProperty.Name,
diskProperty.Value )
Next diskProperty
///

I hope this helps?

Cor


"Terry Olsen" <to******@hotmail.com> schreef in bericht
news:Oa**************@TK2MSFTNGP11.phx.gbl...
Does anyone know how to retrieve the system serial number? I'm writing
an auditing program and need to grab that little bit of info.

Thanks!



Nov 21 '05 #9
I think I found what I need to get the serial number. It's in the
Win32_BaseBoard WMI Class. Now I need help on how to use it. I tried
this:

Dim w32bb As New ManagementObject("Win32_BaseBoard")

But that give me an exception "specified argument was out of the range
of valid values"

Thanks

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 21 '05 #10
I found the following code at
http://www.freevbcode.com/ShowCode.asp?ID=2664. Modified it
ever-so-slightly to work in VB.NET. But it retrieves the SerialNumber.

Dim objs As Object
Dim obj As Object
Dim WMI As Object
WMI = GetObject("WinMgmts:")
objs = WMI.InstancesOf("Win32_BaseBoard")
For Each obj In objs
MsgBox(obj.SerialNumber.ToString)
Next
Nov 21 '05 #11

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

Similar topics

15
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
79
by: Klaus Bonadt | last post by:
In order to protect software from being copied without licence, I would like to use something like a key, which fits only to the current system. The serial number of the CPU or the current...
1
by: Terry Olsen | last post by:
Does anyone know how to retrieve the system serial number? I'm writing an auditing program and need to grab that little bit of info. Thanks!
0
by: steinerh | last post by:
Hi, I am using FSO (VB6.0 proff) to retrieve the serial number of my hardisk. Comparing the number with what WIN XP returns and also what I retrieve using the dir command in DOS is really...
0
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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,...
1
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...
0
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...
0
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,...
0
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
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
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 ...

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.