⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 form1.frm

📁 根据硬盘生产号码,读取硬盘序列号,Visual Basic 程序
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   3090
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   4680
   LinkTopic       =   "Form1"
   ScaleHeight     =   3090
   ScaleWidth      =   4680
   StartUpPosition =   3  '窗口缺省
   Begin VB.CommandButton Command1 
      Caption         =   "Command1"
      Height          =   615
      Left            =   720
      TabIndex        =   1
      Top             =   1920
      Width           =   2175
   End
   Begin VB.TextBox Text1 
      Height          =   1455
      Left            =   120
      MultiLine       =   -1  'True
      TabIndex        =   0
      Text            =   "Form1.frx":0000
      Top             =   120
      Width           =   4215
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
  Private Declare Function DiskID32 Lib "DiskID32.DLL" (ByRef DiskModel As Byte, ByRef DiskID As Byte) As Long

Private Sub Command1_Click()
Dim DiskModel(35) As Byte, DiskID(31) As Byte, i As Integer, Model As String, ID As String
  If DiskID32(DiskModel(0), DiskID(0)) <> 1 Then
    MsgBox "get diskid32 err"
    Exit Sub
  End If
  For i = 0 To 31
    If Chr(DiskModel(i)) <> Chr(0) Then
        Model = Model & Chr(DiskModel(i))
    End If
    If Chr(DiskID(i)) <> Chr(0) Then
        ID = ID & Chr(DiskID(i))
    End If
  Next
  Text1.Text = "硬件产生代码为:" + Model & vbNewLine & "硬盘序列号为:" + ID
End Sub


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -