代码很简单的,很适合新手
Delphi 注册
var
Buf,buf2:array[0..49] of Char;
VolumeNameSize:DWORD;
ret:BOOL;
VolumeSerialNumbe,MaximumComponentLength,FileSystemFlags:DWORD;
i,j:ShortInt;
begin
FillChar(buf,SizeOf(Buf),#0);
FillChar(buf2,SizeOf(Buf),#0);
ret:=GetVolumeInformation(0,@buf,VolumeNameSize,@VolumeSerialNumbe,MaximumComponentLength,FileSystemFlags,0,0);
if not ret then
begin
MessageBox(0,PAnsiChar('GetVolumeInformation Error'),PAnsiChar(IntToStr(GetLastError)),MB_ICONERROR);
exit;
end;
StrCat(buf,PAnsiChar('4562-ABEX'));
for j:=0 to 1 do
begin
for i:=0 to 3 do
begin
Inc(buf[i]);
end;
end;
lstrcpy(buf2,PAnsiChar('L2C-5781'));
StrCat(buf2,Buf);
MessageBox(0,buf2,PAnsiChar('Sucess'),MB_OK);