PB中如何读取具有唯一标识的硬件的序列号?

mars884813 2002-08-15 05:34:33
记得从前抄一段资料上的程序,用VC编译了,糊里糊涂竟也读出了我的机器上的硬盘序列号。好象是用中断异常实现的,PB里该怎样干呢?哪位同志有否什么DLL可以直接用函数调用读取的?
...全文
131 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
ldk 2002-08-16
  • 打赏
  • 举报
回复
上面提供的读的不是物理序列号,我也有一个dll,如果楼上的不行,给我发消息
xing_xing 2002-08-16
  • 打赏
  • 举报
回复
我有读cpu的dll,留下你的地址,我给你e过去。
YewPu 2002-08-15
  • 打赏
  • 举报
回复
获得硬盘系号都是硬盘format时产生的一个号码,如果用户再次format后这个号码就会改变,所以获得硬盘号并不可靠,说实的,Cpu硬的机率最小,最好得到Cpu的系号, jackygan(一剑飘香) 的主页上有这个例子,不过有一个问题,就是有些Cpu可以没有系号的。
LIUZKCZ 2002-08-15
  • 打赏
  • 举报
回复
上面提供的都是读分区序列号,用GHOST软件可以复制,也可用特殊软件生成一个,
最好找一个读硬序列号的程序,我有一个,但有别人的版权,不能给你,请你另找.
jackygan 2002-08-15
  • 打赏
  • 举报
回复
我主页上有一个: http://pbcorner.yeah.net/ PB程序员一角
海洋‘s 2002-08-15
  • 打赏
  • 举报
回复
另一代码:

gf_getyingpanming () ://得到硬盘序列号函数 返回值类型:string

String ls_Rootpath, ls_volumnename ,gs_yingpanming
ls_Rootpath = "c:" // 指定要得到序列号的硬盘,
// 一般情况都是C盘,除非你能保证用户存在其它逻辑盘或物理盘
ls_volumnename = Space(256)
Ulong lul_VolumeNameSize
lul_VolumeNameSize = 256
Ulong lul_VolumeSerialNumber, lul_MaximumComponentLength, lul_FileSystemFlags
lul_MaximumComponentLength = 256
String ls_FileSystemNameBuffer
ls_FileSystemNameBuffer = space(256)
Ulong lul_FileSystemNameSize
lul_FileSystemNameSize = 256
beep(1)
boolean lb_rtn
lb_rtn = False
lb_rtn = GetVolumeInformationA(ls_Rootpath, ls_volumnename, lul_VolumeNameSize,&
lul_VolumeSerialNumber, lul_MaximumComponentLength, lul_FileSystemFlags,&
ls_FileSystemNameBuffer, lul_FileSystemNameSize)
if lb_rtn = true then
gs_yingpanming = String(lul_VolumeSerialNumber) // 得到硬盘序列号
return gs_yingpanming
else
MessageBox("错误!","取得机器码失败,如有问题请与软件供应商联系!",stopsign!)
return ''
end if

********************本人收藏
海洋‘s 2002-08-15
  • 打赏
  • 举报
回复
我给你一段读取硬盘序列号的代码:
全局外部函数:
Function Boolean GetVolumeInformationA( ref String ls_Rootpath,ref String ls_volumnename, Ulong lul_VolumeNameSize,ref Ulong lul_VolumeSerialNumber, ref Ulong lul_MaximumComponentLength,ref Ulong lul_FileSystemFlags, ref String ls_FileSystemNameBuffer,Ulong lul_FileSystemNameSize ) Library "Kernel32.dll"
FUNCTION boolean GetComputerNameA(ref string cname,ref long nbuf)LIBRARY "Kernel32.dll"
function long Sleep(Long ms)library "kernel32"
============================================

全局变量:
boolean gb_logined //用来记录是否已成功注册
============================================

注册窗口的OPEN事件:
String ls_computername , ls_Rootpath , ls_volumnename , gs_yingpanming
String ls_FileSystemNameBuffer
Long ll_nbuf
Ulong lul_VolumeNameSize , lul_VolumeSerialNumber , lul_MaximumComponentLength
Ulong lul_FileSystemFlags ,lul_FileSystemNameSize
Boolean lb_rtn

ls_computername=Space(256)

ll_nbuf=256

st_computername.text=lower(gs_computername) //从全局变量那得到计算机名

ls_Rootpath = "C:" // 指定要得到序列号的硬盘

ls_volumnename = Space(256)
lul_VolumeNameSize = 256

lul_MaximumComponentLength = 256

ls_FileSystemNameBuffer = space(256)

lul_FileSystemNameSize = 256

beep(1)

lb_rtn = False

lb_rtn = GetVolumeInformationA(ls_Rootpath, ls_volumnename, lul_VolumeNameSize,&
lul_VolumeSerialNumber, lul_MaximumComponentLength, lul_FileSystemFlags,&
ls_FileSystemNameBuffer, lul_FileSystemNameSize)

if lb_rtn = true then
st_jiqima.text = String(lul_VolumeSerialNumber) // 得到硬盘序列号
else
MessageBox("错误!","取得机器码失败,如有问题请与软件供应商联系!",stopsign!)
end if

********************本人收藏
wormwang2000 2002-08-15
  • 打赏
  • 举报
回复
用api去www.sybase.com.cn找找
bys_home 2002-08-15
  • 打赏
  • 举报
回复
到liulee上看看
hjd_cw 2002-08-15
  • 打赏
  • 举报
回复
搜以前的帖子吧。

1,079

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder 相关问题讨论
社区管理员
  • 基础类社区
  • WorldMobile
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧