GetHDDInfo --------------------------------------------------------------------------------Allows access to IDE HDDs hardware manufacturer information (HD serial number, geometry, etc.)void GetHDDInfo( HANDLE HW32, USHORT IdeNumber, USHORT Master, HDDInfo * Info );Parameters:HW32 - the handle returned by a successful call to OpenTVicHW32 ; IdeNumber - the selected IDE controller, should be 1..4; Master - should be 1 for "Master disk" or "0" for the "Slave disk"; Info - points to the structure of type HDDInfo, which contains a requsted information.Return Value:None. SCSI不行:)
All fields of this structure is self-documented and not need to be described.typedef struct _HDDInfo { DWORD BufferSize; DWORD DoubleTransfer; DWORD ControllerType; DWORD ECCMode; DWORD SectorsPerInterrupt; DWORD Cylinders; DWORD Heads; DWORD SectorsPerTrack; char Model[41]; char SerialNumber[21]; char Revision[9]; } HDDInfo, *pHDDInfo;
API = 应用程序接口。不管你写的什么应用程序,即使是硬件驱动程序,反正在windows平台上面使用的,最终都要调用win32 API子系统。API不能做的事情,应用程序根本没有办法做到。
要WMI才行。
http://vip.6to23.com/NowCan1/tech/wmi_vb.htm
wmi我也用过,得到的是windows中的逻辑号FUJI.....
而且获得主板的序列号是:0123456789AB(笔记本)
to:ahejn(ahejn)
能发给我吗?[email protected]能用100分奉上
现在找到一些所谓的“方法”:
1、获取C盘的格式化序列号(不足:重新格式化就变,根本就不能做加密的USERID)
2、获取CPU的序列号(不足:有些CPU不支持)
3、获取主板的序列号(不足:比如用WMI获取,在笔记本的主板上就变成了0123456789AB--什么乱七八糟的)
4、获取网卡的序列号(不足:不是每台机器都有网卡,单机版也不需要装网卡)
5、获得硬盘的物理序列号(不足太多了,下面逐条列出)
(1)比较难解决,CSDN中原来微软专家解答的也是获得格式化序列号。
(2)要拷贝一个什么文件到某个目录下,而且仅对WIN98/ME有效。
(3)对NT/2000支持不够,2000下必须以管理员登陆才行。
(4)找不到足够的针对VB获取硬盘序列号的相关资料(也许我太菜,那位老大找到了能用的麻烦通知小弟一声)
....
反正是现在还没解决,郁闷阿~~~
[email protected]
在线
有空发给我,谢谢!
--------------------------------------------------------------------------------Allows access to IDE HDDs hardware manufacturer information (HD serial number, geometry, etc.)void GetHDDInfo(
HANDLE HW32,
USHORT IdeNumber,
USHORT Master,
HDDInfo * Info
);Parameters:HW32 - the handle returned by a successful call to OpenTVicHW32 ;
IdeNumber - the selected IDE controller, should be 1..4;
Master - should be 1 for "Master disk" or "0" for the "Slave disk";
Info - points to the structure of type HDDInfo, which contains a requsted information.Return Value:None.
SCSI不行:)
DWORD DoubleTransfer;
DWORD ControllerType;
DWORD ECCMode;
DWORD SectorsPerInterrupt;
DWORD Cylinders;
DWORD Heads;
DWORD SectorsPerTrack;
char Model[41];
char SerialNumber[21];
char Revision[9]; } HDDInfo, *pHDDInfo;
非常底层的问题应该交给汇编
http://expert.csdn.net/Expert/topic/1199/1199697.xml?temp=.7495539
进来跟贴拿分(专门给你的)这里的分数就分给其他的热心人吧,谢谢了~
至于和win32及汇编的问题(API应该受到WIN2000的安全策略限制,所以可能会有些不足)来彻底的解决这个问题,欢迎有心人继续赐教(新开贴继续给分)