我的u盘是611454092
'返回文件系统信息
Private Declare Function GetVolumeInformation 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
'*************************************************************************
'**函 数 名:getSeriorNumber
'**输 入:sRoot(String) - 逻辑盘符 如: C: D:
'**输 出:(Long) - 序列码
'**功能描述:返回磁盘的序列号
'**全局变量:
'**调用模块:
'**作 者:叶帆
'**日 期:2003年04月19日
'**修 改 人:
'**日 期:
'**版 本:版本1.0
'*************************************************************************
Public Function getSeriorNumber(sRoot As String) As Long
Dim lSerialNum As Long
Dim R As Long
Dim strLabel As String, strType As String
strLabel = String$(255, Chr$(0)) '磁盘卷标
strType = String$(255, Chr$(0)) '文件系统类型 一般为 FAT
R = GetVolumeInformation(sRoot, strLabel, Len(strLabel), lSerialNum, 0, 0, strType, Len(strType))
getSeriorNumber = lSerialNum '在 strLabel 中为 磁盘卷标 '在 strType 中为 文件系统类型
End Function
用这个API看看它有没有序列号
【声明】
Private Declare Function GetVolumeInformation 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
【说明】
获取与一个磁盘卷有关的信息
【返回值】
Long,非零表示成功,零表示失败。会设置GetLastError
【参数表】
lpRootPathName - String,欲获取信息的那个卷的根路径