function ExistNewfile&:boolean; var i,iFileHandle:integer; FileDateTime:TDateTime; AppIni:TiniFile; g_path:string; url:string; files:TStrings; begin result:=false; url:=http://yousoft.hi.com.cn/update.htm/; //要升级的服务器 g_path:=ExtractFilePath(application.ExeName); //升级程序的路径 if copy(g_path,length(g_path),1)<>\ then g_path:=g_path+\; if copy(url,length(url),1)<>/ then url:=url+/;
for i:=0 to files.Count-1 do //备份文件 begin //备份一份文件出来 copyfile(pchar(g_path+files[i]),pchar(g_path+files[i]+.bak),false); end; for i:=0 to files.Count-1 do //从update复制新文件 begin copyfile(pchar(g_path+update\+files[i]),pchar(g_path+files[i]),false); end;