我想用VB开发个共享软件,我看别的共享软件都能生成机器码,并且每台电脑的机器码都不一样。我也想生成机器码,最好是整数,方便我使用(比如【注册码=机器码×26】),没分了,望高手帮忙。不用讲道理,直接给我代码就行了。
我听说有的机器码是Windows的句柄??……
VB生成机器码
答案:1 悬赏:70 手机版
解决时间 2021-02-09 14:53
- 提问者网友:蓝莓格格巫
- 2021-02-08 18:42
最佳答案
- 五星知识达人网友:佘樂
- 2021-02-08 19:38
不如获取硬盘的序列号吧,它是唯一的。
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
Private Sub Form_Load()
Dim AA, 硬盘序列号, Maxlen, Sysflag As Long: Dim VolName, FsysName As String
AA = MymachineC("c:\", VolName, 256, 硬盘序列号, Maxlen, Sysflag, FsysName, 256)
MsgBox "C硬盘序列号-机器码啦-(16制): " & 硬盘序列号
End Sub
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
Private Sub Form_Load()
Dim AA, 硬盘序列号, Maxlen, Sysflag As Long: Dim VolName, FsysName As String
AA = MymachineC("c:\", VolName, 256, 硬盘序列号, Maxlen, Sysflag, FsysName, 256)
MsgBox "C硬盘序列号-机器码啦-(16制): " & 硬盘序列号
End Sub
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯