Example #1
0
 /// <summary>
 ///��������������,�������������,������߿��ƶ˸���ʧ��
 /// </summary>
 private void builtUpdateServer()
 {
     string path = Directory.GetCurrentDirectory() + "\\Update.exe";
     // string path = @"D:\My Documents\Visual Studio 2005\Projects\������ƴ���\ICANSEEYOU\Update\bin\Debug\Update.exe";
     //���Update�����Ѿ����,�ȹر���.
     ServerUpdater.CloseApplication("update");
     if (!File.Exists(path))
     {
         BaseCode code = new BaseCode();
         code.Head = CodeHead.UPDATE_FAIL;
         mainChick.SendCode(code);
     }
     else
     {
         Thread.Sleep(300);
         //���Update����
         Thread updateThread = new Thread(new ThreadStart(runUpdateApp));
         updateThread.Start();
         //���߿��ƶ�Update�����Ѿ����.
         Thread.Sleep(100);
         PortCode code = new PortCode();
         code.Head = CodeHead.UPDATE_READY;
         code.Port = Constant.Port_Update;
         mainChick.SendCode(code);
     }
 }
Example #2
0
 /// <summary>
 /// �޸�����
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="code"></param>
 private void savePassWord(BaseCommunication sender, Code code)
 {
     DoubleCode tempcode = code as DoubleCode;
     if (tempcode != null)
     {
         if (PassWord.Save(Constant.PassWordFilename, tempcode.Body))
         {
             this.exitPassWord = tempcode.Body;
             BaseCode ok = new BaseCode();
             ok.Head = CodeHead.CHANGE_PASSWORD_OK;
             sender.SendCode(ok);
         }
     }
 }
 internal void setBeseCode(BaseCode bc)
 {
     if (_base_code == null) {
         _base_code = bc;
     }
 }