www.pudn.com > 取硬盘物理序列号.zip > Form1.frm


VERSION 5.00 
Begin VB.Form Form1  
   Caption         =   "读取硬盘出厂序列号DEMO" 
   ClientHeight    =   3195 
   ClientLeft      =   60 
   ClientTop       =   345 
   ClientWidth     =   4680 
   LinkTopic       =   "Form1" 
   ScaleHeight     =   3195 
   ScaleWidth      =   4680 
   StartUpPosition =   3  '窗口缺省 
   Begin VB.CommandButton Command1  
      Caption         =   "读取硬盘出厂序列号" 
      Height          =   375 
      Left            =   1320 
      TabIndex        =   1 
      Top             =   1080 
      Width           =   1815 
   End 
   Begin VB.TextBox Text1  
      BeginProperty Font  
         Name            =   "宋体" 
         Size            =   12 
         Charset         =   134 
         Weight          =   400 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      Height          =   375 
      Left            =   720 
      TabIndex        =   0 
      Top             =   360 
      Width           =   2895 
   End 
   Begin VB.Label Label1  
      Caption         =   "Label1" 
      Height          =   375 
      Left            =   600 
      TabIndex        =   2 
      Top             =   1680 
      Width           =   2775 
   End 
End 
Attribute VB_Name = "Form1" 
Attribute VB_GlobalNameSpace = False 
Attribute VB_Creatable = False 
Attribute VB_PredeclaredId = True 
Attribute VB_Exposed = False 
Private Sub Command1_Click() 
Text1.Text = HDSerialNumRead() 
End Sub 
 
Private Sub Form_Load() 
'//判断操作系统类型 
Dim Ver As OSVERSIONINFO 
Ver.dwOSVersionInfoSize = Len(Ver) 
n = GetVersionEx(Ver) 
Select Case Ver.dwPlatformId 
Case VER_PLATFORM_WIN32_WINDOWS 
If Ver.dwMinorVersion >= 10 Then 
Label1.Caption = "操作系统是WIN98" 
Else 
Label1.Caption = "操作系统是WIN95" 
End If 
Case VER_PLATFORM_WIN32_NT 
Label1.Caption = "操作系统是WIN NT/2K/XP" 
End Select 
End Sub