win64 下如何用VB获取硬盘参数,序列号? 5
在32位系统上运行正常的,在64系统上都没有办法获取了,如何解决?环境:windows764位VB6.0...
在32位系统上运行正常的,在64系统上都没有办法获取了,如何解决?环境:windows7 64位VB6.0
展开
2个回答
展开全部
private Declare Function MymachineC 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
dim ReturnValue As Long, HDSN, MaxLen As Long, SysFlag As Long, VolName As String, fSysName As String
private sub commadn1_click()
ReturnValue = MymachineC("C:\", VolName, 256, HDSN, MaxLen, SysFlag, fSysName, 256)
msgbox hdsn,,"硬盘序列号"
end sub
dim ReturnValue As Long, HDSN, MaxLen As Long, SysFlag As Long, VolName As String, fSysName As String
private sub commadn1_click()
ReturnValue = MymachineC("C:\", VolName, 256, HDSN, MaxLen, SysFlag, fSysName, 256)
msgbox hdsn,,"硬盘序列号"
end sub
追问
这个不是吧
这是C盘逻辑盘的序列号,格式化一次就更改一次,这个我能取得,只是是负值,加一语句也能了取得了,我指得是硬盘的物理序列号,是固定的,唯一的.
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询