program minisize;
uses
Windows;
{$R *.RES}
var
nsize:Integer;
hfile:THandle;
strsize:string;
begin
hfile := createfile(PChar(ParamStr(0)),0,file_share_read,nil,open_existing,0,0);
nsize :=getfilesize(hfile,nil);
closehandle(hfile);
SetLength(strsize,20);
Str(nsize,strsize);
messagebox(0,PChar(strsize),'mini program',mb_ok);
end.
我用的new->console application
[Warning] Project2.dpr(4): File not found: 'minisize.RES'
[Error] File not found: 'minisize.RES'
提示1处错误1处警告
uses
Windows;
{$R *.RES}
var
nsize:Integer;
hfile:THandle;
strsize:string;
begin
hfile := createfile(PChar(ParamStr(0)),0,file_share_read,nil,open_existing,0,0);
nsize :=getfilesize(hfile,nil);
closehandle(hfile);
SetLength(strsize,20);
Str(nsize,strsize);
messagebox(0,PChar(strsize),'mini program',mb_ok);
end.
我用的new->console application
[Warning] Project2.dpr(4): File not found: 'minisize.RES'
[Error] File not found: 'minisize.RES'
提示1处错误1处警告
var
nsize:Integer;
hfile:THandle;
strsize:string;
begin
hfile := createfile(PChar(ParamStr(0)),0,file_share_read,nil,open_existing,0,0);
nsize :=getfilesize(hfile,nil);
closehandle(hfile);
SetLength(strsize,20);
Str(nsize,strsize);
messagebox(0,PChar(strsize),'mini program',mb_ok);
end.
为什么回复太短。
少了个end;