客户端中,在局域网若自动更新,自已更新自已并执行,要原码

解决方案 »

  1.   

    哇,接分,接分;
    你可以用回调机制也可以心跳机制;
    怎么用?Midas里看去啊;我那我有源码;
    或是到www.nxit.net/bbs里,我也放了源码,两个例程的源码;
    祝好运;///////这个贴子应该是在Midas里边嘛;
      

  2.   

    to  BoningSword佛曰:不可说~~~不可说~~~◎◎◎◎◎◎◎◎◎◎◎◎◎◎◎
      

  3.   

    BoningSword(我爱的人名花有主,爱我的人惨不忍睹)说 :
           广告满天飞啊,简直比网络时代的烧钱运动还热乎,呵呵。
    del_c_sharp(摩托还需骆拉)说:
          我是佛,: 佛曰:不可说~~~不可说~~~◎◎◎◎◎◎◎◎◎◎◎◎◎◎◎
    小小说:摩托吃人不吐骨头,我踩你!BoningSword,小小下次不敢了;嘻嘻
      

  4.   

    //==============================================================================
    //客户端.从服务器指定的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;