比较\\MAINSERVER\DEPOT$\CAIGOU.EXE 和本地caigou.exe文件的大小,如果一样大则不用更新,并运行本地caigou.exe程序,不一样大小则自动下载替换本地文件,才写到运行本地程序的部分就写不下去了。
就是下面两句
Winexec('Notepad.exe',sw_Normal);winexec(PChar(ExtractFilePath(Paramstr(0))+'caigou.exe'),sw_Normal); //'E:\tj\work\update\caigou.exe'这两句我在新建的工程里可以运行成功,但在我的工程就不能打开caigou.exe
帮我看看procedure TForm1.FormShow(Sender: TObject);
var
lfile,sfile: file of Byte;
lfsize,sfsize:longint;
filename,serverpath:string;
begin
upinifile:=Tinifile.Create(ExtractFilePath(Paramstr(0))+'filelist.ini');
filename:=upinifile.Readstring('filelist','mainfile','caigou');AssignFile(lfile, ExtractFilePath(Paramstr(0))+'caigou.exe');
Reset(lfile);
lfsize := FileSize(lfile);assignfile(sfile,'\\mainserver\depot$\caigou.exe');
reset(sfile);
sfsize:=filesize(sfile);if lfsize=sfsize then
begin
Winexec('Notepad.exe',sw_Normal);winexec(PChar(ExtractFilePath(Paramstr(0))+'caigou.exe'),sw_Normal); //'E:\tj\work\update\caigou.exe'
showmessage('不需要更新!!!!!!!!!!!');
end
else
begin
showmessage('需要更新');end;end;
就是下面两句
Winexec('Notepad.exe',sw_Normal);winexec(PChar(ExtractFilePath(Paramstr(0))+'caigou.exe'),sw_Normal); //'E:\tj\work\update\caigou.exe'这两句我在新建的工程里可以运行成功,但在我的工程就不能打开caigou.exe
帮我看看procedure TForm1.FormShow(Sender: TObject);
var
lfile,sfile: file of Byte;
lfsize,sfsize:longint;
filename,serverpath:string;
begin
upinifile:=Tinifile.Create(ExtractFilePath(Paramstr(0))+'filelist.ini');
filename:=upinifile.Readstring('filelist','mainfile','caigou');AssignFile(lfile, ExtractFilePath(Paramstr(0))+'caigou.exe');
Reset(lfile);
lfsize := FileSize(lfile);assignfile(sfile,'\\mainserver\depot$\caigou.exe');
reset(sfile);
sfsize:=filesize(sfile);if lfsize=sfsize then
begin
Winexec('Notepad.exe',sw_Normal);winexec(PChar(ExtractFilePath(Paramstr(0))+'caigou.exe'),sw_Normal); //'E:\tj\work\update\caigou.exe'
showmessage('不需要更新!!!!!!!!!!!');
end
else
begin
showmessage('需要更新');end;end;
解决方案 »
- 我想读取数据文件(.DAT)上的一些坐标点(二维的),同时在Tchart上利用这些点可以直接绘出一条曲线来,请问怎么编,谢谢!
- 请教提交TWebBrowser按钮的问题,框架结构
- 高手,請指點一下
- 求助:急需《Delphi DirectX图形与游戏程序设计 》 电子科技大学出版社
- 请教一个简单的问题,原来安装了fastreport2.44版本,现在想安装最新版本,如何将原来的版本从控制面板中去掉啊,谢谢。送分题阿
- LOCALE_USER_DEFAULT含义
- 为什么ADO+Sql 7.0 三层中使用ClientDataSet1.Locate(字段,值,[locaseinsensitive,lopartialkey])时有问题
- 如何通过键盘操作展开combobox1的下拉列表?
- delphi 表达式编译器
- 救急!!!!!!!
- PCHAR
- 如何用DELPHI编程实现快速搜索WORD里的字符串!
-------------------看个简易的
unit Unit1;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs;type
TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.dfm}procedure TForm1.FormCreate(Sender: TObject);
var
lfile,sfile: file of Byte;
lfsize,sfsize:longint;
begin
AssignFile(lfile, 'E:\tj\work\update\caigou.exe');
Reset(lfile);
lfsize := FileSize(lfile);assignfile(sfile,'\\mainserver\depot$\caigou.exe');
reset(sfile);
sfsize:=filesize(sfile);if lfsize=sfsize then//如果两个文件大小一样
begin
Winexec('Notepad.exe',sw_Normal);//记事本可以打开
winexec('E:\tj\work\update\caigou.exe',sw_Normal); //这个就不行了
showmessage('不需要更新!!!!!!!!!!!');
end
else
begin
showmessage('需要更新');end;
end;end.