老师,在这个代码上作作文章
Option Explicit
Private Declare Function DiskID32 Lib "DiskID32.DLL" (ByRef DiskModel As Byte, ByRef DiskID As Byte) As Long
Sub huoquzhucema()
Dim DiskModel(31) 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
MsgBox "硬件产生代码为:" + Model
MsgBox "硬盘序列号为:" + ID
你好,我看不懂下面的代码,请给解释一下各行的意思
Private Sub TextBox1_Change()
If Not IsNumeric(TextBox1.Value) And TextBox1.Value <> "" Then
Application.EnableEvents = False
MsgBox "你必须输入数字!"
TextBox1 = ""
Application.EnableEvents = True
End If
End Sub
你好,这是你给我的代码
Private Sub TextBox1_Change()
If Not IsNumeric(TextBox1.Value) And TextBox1.Value <> "" Then
Application.EnableEvents = False
MsgBox "你必须输入数字!"
TextBox1 = ""
Application.EnableEvents = True
End If
End Sub
我看不懂,请解释一下各行代码的含义
谢谢