Vb6 Get Serial Number
Posted : admin On 5/29/2019I have to write a Visual Basic 6.0 Program and need to uniquely identify a
computer in a network and the user mustn't be able to change that id while my
program is running. So the Volume Serial Number of the HDD isn't a possibility,
because you can set the Volume SN whatever you want and therefore it's not
unique in a Network. I heard that there's a manufacturer's Serial Number on the
HDD that can't be changed and that is unique (worldwide?). How can I get that SN
with VB6? Or do you have any other ideas? Like a BIOS SN?
Thanks a lot in advance,
Michael
PS: Answer in German is ok.
Sep 30, 2009 - Re: Hard Serial Number In VB6, Wolf Wendel, 9/30/09 1:20 AM. Hidden in a PC you might put an exactly question and surely get an exactly.
Vb6 Get Serial Number
This topic describes how to use My.Computer.Ports
to show the available serial ports of the computer in Visual Basic.
To allow a user to select which port to use, the names of the serial ports are placed in a ListBox control.
Example
Get Serial Number
This example loops over all the strings that the My.Computer.Ports.SerialPortNames
property returns. These strings are the names of the available serial ports on the computer.
Typically, a user selects which serial port the application should use from the list of available ports. In this example, the serial port names are stored in a ListBox control. For more information, see ListBox Control.
This code example is also available as an IntelliSense code snippet. In the code snippet picker, it is located in Connectivity and Networking. For more information, see Code Snippets.
Compiling the Code
Vb6 Get Cpu Serial Number
This example requires:
A project reference to System.Windows.Forms.dll.
Access to the members of the System.Windows.Forms namespace. Disable protexis licensing v2 in windows services. Add an
Imports
statement if you are not fully qualifying member names in your code. For more information, see Imports Statement (.NET Namespace and Type).That your form have a ListBox control named
ListBox1
.
Robust Programming
You do not have to use the ListBox control to display the available serial port names. Instead, you can use a ComboBox or other control. If the application does not need a response from the user, you can use a TextBox control to display the information.
Note
The port names returned by My.Computer.Ports.SerialPortNames
may be incorrect when run on Windows 98. To prevent application errors, use exception handling, such as the Try..Catch..Finally
statement or the Using
statement, when using the port names to open ports.