473,320 Members | 1,861 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,320 software developers and data experts.

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 14911
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...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.