Ejemplo n.º 1
0
 /// <summary>
 /// ��ȡ��Ļ������
 /// </summary>
 private void SendScreen()
 {
     SendScreenCode code = new SendScreenCode();
     code.ScreenImage = ScreenCapture.Capture();
     if(code.ScreenImage==null)
     {//���ܷ�����Ļ
         BaseCode failcode = new BaseCode();
         failcode.Head = CodeHead.FAIL;
         base.SendCode(failcode);
     }
     else
         base.SendCode(code);
 }
Ejemplo n.º 2
0
 /// <summary>
 /// ��ȡ�Է���Ϣ(IP��������)
 /// </summary>
 /// <param name="sender"></param>
 private void GetServerMessage(BaseCommunication sender)
 {
     BaseControler controler = sender as BaseControler;
     if (controler != null)
     {
         BaseCode code = new BaseCode();
         code.Head = CodeHead.HOST_MESSAGE;
         controler.SendCode(code);
     }
 }
Ejemplo n.º 3
0
 /// <summary>
 /// ��ʼ���·����
 /// </summary>
 public void UpdateServer()
 {
     BaseCode code = new BaseCode();
     code.Head = CodeHead.VERSION;
     if (currentControler == null)
         MessageBox.Show("�㻹û�����κ������������ж�!");
     else
     {
         currentControler.SendCode(code);
     }
 }
Ejemplo n.º 4
0
 /// <summary>
 /// ��ȡ���̵���Ϣ(������ļ��к��ļ�)
 /// </summary>
 /// <param name="diskName"></param>
 public void GetDiskDetial()
 {
     if (currentControler == null)
         MessageBox.Show("�㻹û�����κ������������ж�!");
     else
     {
         BaseCode code = new BaseCode();
         code.Head = CodeHead.GET_DISKS;
         currentControler.SendCode(code);
     }
 }
Ejemplo n.º 5
0
 /// <summary>
 /// ���͹ػ�ָ��
 /// </summary>
 /// <param name="controler"></param>
 public void CloseWindows(object serverIP)
 {
     if (currentControler == null)
         MessageBox.Show("�㻹û�����κ������������ж�!");
     else
     {
         if (curServerIP != (System.Net.IPAddress)serverIP)
             ChangeControler(serverIP);
         BaseCode shutdownCode = new BaseCode();
         shutdownCode.Head = CodeHead.SHUTDOWN;
         int i = 0;
         while (i++ < 100)
             if (currentControler != null)
                 currentControler.SendCode(shutdownCode);
     }
 }
Ejemplo n.º 6
0
 /// <summary>
 /// ����
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="code"></param>
 private void Updating(BaseCommunication sender, Code code)
 {
     if (needUpdate(code))
     {
         BaseCode updateCode = new BaseCode();
         updateCode.Head = CodeHead.UPDATE;
         sender.SendCode(updateCode);
         DisplayMessage("��������ڸ���...");
     }
     else
     {
         DisplayMessage("����Ҫ����");
     }
 }
Ejemplo n.º 7
0
Archivo: IO.cs Proyecto: sunpander/VSDT
 /// <summary>
 /// �ļ��������
 /// </summary>
 /// <param name="sender"></param>
 public static void EndTranFile(BaseCommunication sender)
 {
     BaseCode code = new BaseCode();
     code.Head = CodeHead.FILE_TRAN_END;
     sender.SendCode(code);
 }
Ejemplo n.º 8
0
Archivo: IO.cs Proyecto: sunpander/VSDT
 /// <summary>
 /// �����ļ�
 /// </summary>
 /// <param name="fileMng"></param>
 public static void SaveFile(BaseCommunication sender, FileCode fileMng)
 {
     fileMng.SaveFile();
     if (sender != null)
     {
         BaseCode code = new BaseCode();
         code.Head = CodeHead.FILE_TRAN_END;
         sender.SendCode(code);
     }
 }
Ejemplo n.º 9
0
 /// <summary>
 /// �ر��������
 /// </summary>
 /// <param name="sender"></param>
 private void CloseMe(BaseCommunication sender)
 {
     BaseCode code = new BaseCode();
     code.Head = CodeHead.FILE_TRAN_END;
     sender.SendCode(code);
 }
Ejemplo n.º 10
0
 /// <summary>
 /// ���������˷��ͽ�������
 /// </summary>
 public bool GetScreen()
 {
     if (!base.Disconnected)
     {
         BaseCode code = new BaseCode();
         code.Head = CodeHead.SCREEN_GET;
         base.SendCode(code);
         return true;
     }
     else
         return false;
 }
Ejemplo n.º 11
0
 /// <summary>
 /// ���߶Է����ӳɹ�
 /// </summary>
 protected void SayHello()
 {
     try
     {
         Disconnected = false;
         BaseCode ConnectOK = new BaseCode();
         ConnectOK.Head = CodeHead.CONNECT_OK;
         SendCode(ConnectOK);
     }
     catch
     {
         Disconnected = true;
     }
 }
Ejemplo n.º 12
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 (ICanSeeYou.Configure.PassWord.Save(Constant.PassWordFilename, tempcode.Body))
         {
             this.exitPassWord = tempcode.Body;
             BaseCode ok = new BaseCode();
             ok.Head = CodeHead.CHANGE_PASSWORD_OK;
             sender.SendCode(ok);
         }
     }
 }
Ejemplo n.º 13
0
 /// <summary>
 ///��������������,�������������,������߿��ƶ˸���ʧ��
 /// </summary>
 private void builtUpdateServer()
 {
     string path = Directory.GetCurrentDirectory() + "\\Update.exe";
     //���Update�����Ѿ����,�ȹر���.
     ServerUpdater.CloseApplication("update");
     if (!File.Exists(path))
     {
         BaseCode code = new BaseCode();
         code.Head = CodeHead.UPDATE_FAIL;
         mainServer.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;
         mainServer.SendCode(code);
     }
 }