Finds the Hard Drive Serial Number, Motherboard Serial Number, Local HostName, Local Ip, Local port
Finds the Hard Drive Serial Number, Motherboard Serial Number, Local HostName, Local Ip, Local port, And Includes A Function so you can add
Rate Finds the Hard Drive Serial Number, Motherboard Serial Number, Local HostName, Local Ip, Local port
(2(2 Vote))
'5 labels (label1-5)
'1 command button (command1)
'1 winsock (winsock1)
'to get winsock goto project, components,Microsoft Winsock Controls 6.0
Option Explicit
Private Declare Function GetVolumeInformation Lib "kernel32.dll" Alias "GetVolumeInformationA" (ByVal lpRootPathName As String, ByVal lpVolumeNameBuffer As String, ByVal nVolumeNameSize As Integer, lpVolumeSerialNumber As Long, lpMaximumComponentLength As Long, lpFileSystemFlags As Long, ByVal lpFileSystemNameBuffer As String, ByVal nFileSystemNameSize As Long) As Long
Private Sub Command1_Click()
Dim objs
Dim obj
Dim WMI
Set WMI = GetObject("WinMgmts:")
Set objs = WMI.InstancesOf("Win32_BaseBoard")
For Each obj In objs
label2.Caption = "MotherBoard Num: " & obj.SerialNumber
Next
Label1.Caption = "HDD Serial Num: " & GetSerialNumber("C:\")
label3.Caption = "Local IP Address: " & Winsock1.LocalIP
label4.Caption = "Local Host Name: " & Winsock1.LocalHostName
label5.Caption = "Local Port: " & Winsock1.LocalPort
End Sub
Function GetSerialNumber(strDrive As String) As Long
'
'
Dim SerialNum As Long
Dim Res As Long
Dim Temp1 As String
Dim Temp2 As String
'
Temp1 = String$(255, Chr$(0))
Temp2 = String$(255, Chr$(0))
Res = GetVolumeInformation(strDrive, Temp1, _
Len(Temp1), SerialNum, 0, 0, Temp2, Len(Temp2))
'
GetSerialNumber = SerialNum
End Function
Finds the Hard Drive Serial Number, Motherboard Serial Number, Local HostName, Local Ip, Local port Comments
No comments yet — be the first to post one!
Post a Comment