Example #1
0
 public Processor()
 {
     hotkey    = new string[4];
     hotkey[0] = hotkey[1] = hotkey[2] = hotkey[3] = "temp";
     loadSettingFromCurrnet();   //저장된 설정으로 값 변경
     registerUser(id);           //서버에 id 등록
     tcpserver = new Timer_TCPServer.TCPServer(this);
     tcpserver.Connent(ip, int.Parse(portNum));
     tcpserver.Start();
 }
Example #2
0
        // 메소드

        public MainForm()
        {
            InitializeComponent();

            tboxLog.ScrollBars = ScrollBars.Vertical;

            string fName = "option.txt";             // 전체경로를 지정해 줘야함
            string resultString;

            try
            {
                FileStream open = new FileStream(fName, FileMode.Open);

                StreamReader read = new StreamReader(open, Encoding.Default);

                resultString = read.ReadToEnd();

                string[] result = resultString.Split('/');
                id      = result[0];
                ip      = result[1];
                portNum = int.Parse(result[2]);
            }
            catch (FileLoadException e)
            {
                id      = null;
                ip      = "210.94.194.100";
                PortNum = 20151;

                MessageBox.Show(e.ToString());
            }

            ntfIcon = notifyIcon1;

            if (id != null)
            {
                string message = cmdWrite + "&" + wakeUp;
                string URL     = logURL + "?id=" + id + "&" + message;

                SendRequest(message, URL);

                firstOrNot = false;
            }

            tboxID.Text = id;

            server = new Timer_TCPServer.TCPServer(this);

            SetToolStripEnabled();

            // 프로그램 실행시 자동실행 카운트다운 시작
            SetTimerForAutoExecution();

            // 프로그램 시작시 마스터 서버에 연결
            ConnectToServer();
        }