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

📄 module1.bas

📁 vb一个通过硬件信息生成序列号的源码示例
💻 BAS
字号:
Attribute VB_Name = "Module1"
'****************************************************************************
'人人为我,我为人人
'枕善居汉化收藏整理
'发布日期:05/03/31
'描  述:一个通过硬件信息生成序列号的源码示例
'网  站:http://www.mndsoft.com
'e-mail:mnd@mndsoft.com
'OICQ  : 88382850
'****************************************************************************
Public Declare Function GetVolumeInformation Lib "kernel32" Alias "GetVolumeInformationA" (ByVal lpRootPathName As String, ByVal lpVolumeNameBuffer As String, ByVal nVolumeNameSize As Long, lpVolumeSerial_Numberber As Long, lpMaximumComponentLength As Long, lpFileSystemFlags As Long, ByVal lpFileSystemNameBuffer As String, ByVal nFileSystemNameSize As Long) As Long
Public Const GETDI_SERIAL = 1
Public Const GETDI_LABEL = 2
Public Const GETDI_TYPE = 3
Function GetDriveInfo(strDrive As String, iType As Integer)
    
    Dim Serial_Number As Long
    Dim Drive_Label As String
    Dim Fat_Type As String
    
    Dim Return_Value As Long
    
    Drive_Label = Space(256)
    Fat_Type = Space(256)
    
    Return_Value = GetVolumeInformation(strDrive, Drive_Label, Len(Drive_Label), Serial_Number, 0, 0, Fat_Type, Len(Fat_Type))
    
    GetDriveInfo = CStr(Serial_Number)

End Function

⌨️ 快捷键说明

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