procedure MOVEOUT(fromname, todir: string); var toname: string; p_from: pansichar; p_to: pansichar; begin if FileExists(Trim(fromname)) then begin toname := trim(todir + trim(ExtractFileName(fromname))); p_from := @fromname[1]; p_to := @toname[1]; if not movefile(p_from, p_to) then raise Exception.create('Unable to move file,可能是目的文件已经存在^_^'+fromname); newfilename := toname; end else ShowMessage('not exist!!' + fromname); end;
var
toname: string;
p_from: pansichar;
p_to: pansichar;
begin
if FileExists(Trim(fromname)) then
begin
toname := trim(todir + trim(ExtractFileName(fromname)));
p_from := @fromname[1];
p_to := @toname[1];
if not movefile(p_from, p_to) then
raise Exception.create('Unable to move file,可能是目的文件已经存在^_^'+fromname);
newfilename := toname;
end
else
ShowMessage('not exist!!' + fromname);
end;