怎样制作生成序列号?要求改序列号只能在针对某台机器使用,在其他的机器上不能使用
解决方案 »
- 如何用WebBrowser编写多窗口浏览器,像傲游浏览器那样?已经看了一些myie源代码...
- 控制word问题2
- 如何判断子窗口是否已经被创建
- 在哪里启动ActiveForm?
- 怎么在程序中判断一个exe文件是否正在运行?
- Ado怎样删除记录?
- 各位高手:一个使用TBatchMove的问题
- 如何判断当前日期是星期六、星期天?
- ----delphi.csdn 大会胜利召开--(会议纪实)地点:qq聊天室自建14,delphi.csdn 时间:19:00-22:00
- Delphi7 用BOM展开物料清单问题
- 一个动人的爱情故事!!!!!!!!!!!!!!!!
- 向各位老大求助,关于Erwin的问题!急啊(在线等候)
摘 要:不是取得卷标号,而是物理ID号
关键字:磁盘序列号
类 别:系统控制
type
MIDPtr = ^MIDRec;
MIDRec = Record
InfoLevel: word;
SerialNum: LongInt;
VolLabel: Packed Array [0..10] of Char;
FileSysType: Packed Array [0..7] of Char;
end;function GetDriveSerialNum(MID: MIDPtr; drive: Word): Boolean; assembler;
asm
push DS { Just for safety, I dont think its really needed }
mov ax,440Dh { Function Get Media ID }
mov bx,drive { drive no (0-Default, 1-A ...) }
mov cx,0866h { category and minor code }
lds dx,MID { Load pointeraddr. }
call DOS3Call { Supposed to be faster than INT 21H }
jc @@err
mov al,1 { No carry so return TRUE }
jmp @@ok
@@err:
mov al,0 { Carry set so return FALSE }
@@ok:
pop DS { Restore DS, were not supposed to change it }
end;procedure TForm1.NrBtnClick(Sender: TObject);
var
Info: MIDRec;
begin
Info.InfoLevel:=0; { Information Level }
If GetDriveSerialNum(@Info,0) then { Do something with it... }
ListBox.Items.Add(IntToStr(Info.SerialNum)+' '+Info.VolLabel);
end;--------------------------------------------------------------------------------
BOOL GetVolumeInformation( LPCTSTR lpRootPathName, // address of root directory of the file system
LPTSTR lpVolumeNameBuffer, // address of name of the volume
DWORD nVolumeNameSize, // length of lpVolumeNameBuffer
LPDWORD lpVolumeSerialNumber, // address of volume serial number
LPDWORD lpMaximumComponentLength, // address of system's maximum filename length
LPDWORD lpFileSystemFlags, // address of file system flags
LPTSTR lpFileSystemNameBuffer, // address of name of file system
DWORD nFileSystemNameSize // length of lpFileSystemNameBuffer
);
获取硬盘序列号或者CPU序列号
取电脑CPU序列号、网卡MAC地址、主板BIOS、操作系统序列号的Delphi控件(v 1.0)