[c++] vb取 硬盘序列号(16制)

[复制链接]
梅雷工具箱发表于 2015-6-25 13:55:55 | 显示全部楼层 |阅读模式
vb取 硬盘序列号(16制)



'取硬盘序列号
Private Declare Function hardisk Lib "kernel32" Alias "GetVolumeInformationA" (ByVal lpRootPathName As String, ByVal lpVolumeNameBuffer As String, ByVal nVolumeNameSize As Long, lpVolumeSerialNumber As Long, lpMaximumComponentLength As Long, lpFileSystemFlags As Long, ByVal lpFileSystemNameBuffer As String, ByVal nFileSystemNameSize As Long) As Long


Private Sub Form_Load()
On Error Resume Next '遇到错误,直接执行下一行。

    Dim aa As Long
    Dim VolName As String
    Dim disnun As Long
    Dim Maxlen As Long
    Dim Sysflag As Long
    Dim fsysName As String
    aa = hardisk("c:\", VolName, 256, disnun, Maxlen, Sysflag, fsysName, 256)
   Text1 = "c 硬盘序列号(16制): " & Hex(disnun)

End Sub
_____________________________________________________________________________ _

中磊UG二次开发教程 梅雷著 qq1821117007
学UG就上UG网 http://www.9sug.com/
就上UG网淘宝直营店
您需要登录后才可以回帖 登录 | 注册UG网 用百度帐号登录

本版积分规则