在局域网中自动更新 客户端中,在局域网若自动更新,自已更新自已并执行,要原码 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 哇,接分,接分;你可以用回调机制也可以心跳机制;怎么用?Midas里看去啊;我那我有源码;或是到www.nxit.net/bbs里,我也放了源码,两个例程的源码;祝好运;///////这个贴子应该是在Midas里边嘛; to BoningSword佛曰:不可说~~~不可说~~~◎◎◎◎◎◎◎◎◎◎◎◎◎◎◎ BoningSword(我爱的人名花有主,爱我的人惨不忍睹)说 : 广告满天飞啊,简直比网络时代的烧钱运动还热乎,呵呵。del_c_sharp(摩托还需骆拉)说: 我是佛,: 佛曰:不可说~~~不可说~~~◎◎◎◎◎◎◎◎◎◎◎◎◎◎◎小小说:摩托吃人不吐骨头,我踩你!BoningSword,小小下次不敢了;嘻嘻 //==============================================================================//客户端.从服务器指定的FTP地址下载最新程序**************************************//==============================================================================procedure ClientDownload;var NMFTP: TNMFTP;begin NMFTP := TNMFTP.Create(nil); NMFTP.Vendor := 2411; NMFTP.Host := Master.Computer; NMFTP.Port := 21; NMFTP.Timeout := 5000; NMFTP.UserID := 'anonymous'; NMFTP.Password := '[email protected]'; try NMFTP.Connect; NMFTP.Download(Slave.AppName, Slave.AppPath + Slave.AppName + '~'); finally NMFTP.Disconnect; NMFTP.Free; end;end;//==============================================================================//客户端.用下载的程序更新原程序*************************************************//==============================================================================procedure ClientReplace;var ProcessInfo: TProcessInformation; StartUpInfo: TStartupInfo; BatchFileName: string; BatchFile: TextFile;begin BatchFileName := ChangeFileExt(Paramstr(0),'.bat'); //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ AssignFile(BatchFile, BatchFileName); Rewrite(BatchFile); //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Writeln(BatchFile, ':try'); Writeln(BatchFile, 'del "' + Slave.AppPath + Slave.AppName + '"'); Writeln(BatchFile, 'if exist "' + Slave.AppPath + Slave.AppName + '" goto try'); Writeln(BatchFile, 'if not exist "' + Slave.AppPath + Slave.AppName + '" ren "' + Slave.AppPath + Slave.AppName + '~" "' + Slave.AppName + '"'); //自启动~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //Writeln(BatchFile, 'if exist "' + Slave.AppPath + Slave.AppName + '" "' + Slave.AppPath + Slave.AppName + '"'); Writeln(BatchFile, 'del %0'); CloseFile(BatchFile); //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FillChar(StartUpInfo, SizeOf(StartUpInfo), $00); StartUpInfo.dwFlags := STARTF_USESHOWWINDOW; StartUpInfo.wShowWindow := SW_HIDE; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if CreateProcess(nil,PChar(BatchFileName),nil,nil,False,IDLE_PRIORITY_CLASS,nil,nil,StartUpInfo,ProcessInfo) then begin CloseHandle(ProcessInfo.hThread); CloseHandle(ProcessInfo.hProcess); end;end; 请教如何将TGetHeader=Function(var pfc翻译成vb代码?! case语句各条件间能否跳转? Tdbgrid为什么不能提交修改. CloseFile Close 的区别 各位大侠帮我详细一下这段代码的含义行吗? 关于数据库管理培训,各位帮忙啊 SQL SERVER 数据库备份后成一个文件,请问怎么样可以对此文件加密呢? 关于EXE文件中含有EXE文件的问题! 请问有什么代理服务器可以保存客户端的发的邮件内容? 请问一下AVISaveV函数是干什么的!!??? 注意!谁有关于delphi怎样调用JavaScript,xml的资料!急! 如何编写自动更新程?
你可以用回调机制也可以心跳机制;
怎么用?Midas里看去啊;我那我有源码;
或是到www.nxit.net/bbs里,我也放了源码,两个例程的源码;
祝好运;///////这个贴子应该是在Midas里边嘛;
广告满天飞啊,简直比网络时代的烧钱运动还热乎,呵呵。
del_c_sharp(摩托还需骆拉)说:
我是佛,: 佛曰:不可说~~~不可说~~~◎◎◎◎◎◎◎◎◎◎◎◎◎◎◎
小小说:摩托吃人不吐骨头,我踩你!BoningSword,小小下次不敢了;嘻嘻
//客户端.从服务器指定的FTP地址下载最新程序**************************************
//==============================================================================
procedure ClientDownload;
var NMFTP: TNMFTP;
begin
NMFTP := TNMFTP.Create(nil);
NMFTP.Vendor := 2411;
NMFTP.Host := Master.Computer;
NMFTP.Port := 21;
NMFTP.Timeout := 5000;
NMFTP.UserID := 'anonymous';
NMFTP.Password := '[email protected]';
try
NMFTP.Connect;
NMFTP.Download(Slave.AppName, Slave.AppPath + Slave.AppName + '~');
finally
NMFTP.Disconnect;
NMFTP.Free;
end;
end;//==============================================================================
//客户端.用下载的程序更新原程序*************************************************
//==============================================================================
procedure ClientReplace;
var ProcessInfo: TProcessInformation;
StartUpInfo: TStartupInfo;
BatchFileName: string;
BatchFile: TextFile;
begin
BatchFileName := ChangeFileExt(Paramstr(0),'.bat');
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
AssignFile(BatchFile, BatchFileName);
Rewrite(BatchFile);
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Writeln(BatchFile, ':try');
Writeln(BatchFile, 'del "' + Slave.AppPath + Slave.AppName + '"');
Writeln(BatchFile, 'if exist "' + Slave.AppPath + Slave.AppName + '" goto try');
Writeln(BatchFile, 'if not exist "' + Slave.AppPath + Slave.AppName + '" ren "' + Slave.AppPath + Slave.AppName + '~" "' + Slave.AppName + '"');
//自启动~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//Writeln(BatchFile, 'if exist "' + Slave.AppPath + Slave.AppName + '" "' + Slave.AppPath + Slave.AppName + '"');
Writeln(BatchFile, 'del %0');
CloseFile(BatchFile);
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
FillChar(StartUpInfo, SizeOf(StartUpInfo), $00);
StartUpInfo.dwFlags := STARTF_USESHOWWINDOW;
StartUpInfo.wShowWindow := SW_HIDE;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
if CreateProcess(nil,PChar(BatchFileName),nil,nil,False,IDLE_PRIORITY_CLASS,nil,nil,StartUpInfo,ProcessInfo) then
begin
CloseHandle(ProcessInfo.hThread);
CloseHandle(ProcessInfo.hProcess);
end;
end;