📄 form1.frm
字号:
VERSION 5.00
Object = "{248DD890-BB45-11CF-9ABC-0080C7E7B78D}#1.0#0"; "MSWINSCK.OCX"
Begin VB.Form Form1
Caption = "根据计算机信息生成序列号"
ClientHeight = 3045
ClientLeft = 60
ClientTop = 345
ClientWidth = 6630
LinkTopic = "Form1"
ScaleHeight = 3045
ScaleWidth = 6630
StartUpPosition = 1 '所有者中心
Begin VB.TextBox Text3
BackColor = &H00FFFFFF&
BeginProperty Font
Name = "宋体"
Size = 15.75
Charset = 134
Weight = 700
Underline = 0 'False
Italic = -1 'True
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C0C000&
Height = 750
Left = 255
MultiLine = -1 'True
TabIndex = 6
Top = 1935
Width = 4600
End
Begin VB.TextBox Text2
BackColor = &H00FFFFFF&
BeginProperty Font
Name = "宋体"
Size = 15.75
Charset = 134
Weight = 700
Underline = 0 'False
Italic = -1 'True
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C0C000&
Height = 435
Left = 240
TabIndex = 4
Top = 1230
Width = 4600
End
Begin VB.CommandButton Command2
Caption = "生成序列号"
Height = 510
Left = 5115
TabIndex = 2
Top = 1500
Width = 1335
End
Begin VB.CommandButton Command3
Caption = "退出"
Height = 510
Left = 5115
TabIndex = 1
Top = 2205
Width = 1335
End
Begin VB.TextBox Text1
BackColor = &H00FFFFFF&
BeginProperty Font
Name = "宋体"
Size = 15.75
Charset = 134
Weight = 700
Underline = 0 'False
Italic = -1 'True
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C0C000&
Height = 435
Left = 270
TabIndex = 0
Top = 450
Width = 4600
End
Begin MSWinsockLib.Winsock Winsock1
Left = 5265
Top = 570
_ExtentX = 741
_ExtentY = 741
_Version = 393216
End
Begin VB.Label Label4
Height = 300
Left = 3495
TabIndex = 8
Top = 90
Width = 3030
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "计算机名称"
Height = 285
Left = 255
TabIndex = 7
Top = 975
Width = 1965
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "生成序列号为:"
Height = 285
Left = 225
TabIndex = 5
Top = 1710
Width = 1965
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "C:盘序列号为:"
Height = 285
Left = 285
TabIndex = 3
Top = 225
Width = 2685
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
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 Form_Load()
Dim mySerial As Long
Dim mylong As Long
mystr = String$(255, Chr$(0))
mytype = String$(255, Chr$(0))
sRoot = "c:\" '设定获取C盘序列号
mylong = GetVolumeInformation(sRoot, mystr, Len(mystr), mySerial, 0, 0, mytype, Len(mytype))
Text1.Text = mySerial 'TEXT1存放C盘序列号
Text2.Text = Winsock1.LocalHostName 'TEXT2存放主机名
Label4.Caption = "今天是: " & Date 'LABEL4存放日期信息
End Sub
Private Sub Command2_Click()
Text3.Text = Date & Text2.Text & Text1.Text '生成序列号
End Sub
Private Sub Command3_Click()
End
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -