procedure TForm1.Button1Click(Sender: TObject);
var
SerialNum : pdword;
a, b : dword;
Buffer : array [0..255] of char;
begin
if GetVolumeInformation('C:\', Buffer, SizeOf(Buffer), SerialNum,
a, b, nil, 0) then
Label1.Caption:=IntToStr(SerialNum^);
end;
在Label1.Caption:=IntToStr(SerialNum^);这一句报错:[Error] Unit1.pas(35): Illegal character in input file: ' ' ($A1A1)。该怎样改正?
var
SerialNum : pdword;
a, b : dword;
Buffer : array [0..255] of char;
begin
if GetVolumeInformation('C:\', Buffer, SizeOf(Buffer), SerialNum,
a, b, nil, 0) then
Label1.Caption:=IntToStr(SerialNum^);
end;
在Label1.Caption:=IntToStr(SerialNum^);这一句报错:[Error] Unit1.pas(35): Illegal character in input file: ' ' ($A1A1)。该怎样改正?
你的空格在与句“Label1.Caption:=IntToStr(SerialNum^);”的前面,删除就可以了。
你的空格在与句“Label1.Caption:=IntToStr(SerialNum^);”的前面,删除就可以了。