Exemple #1
0
        private void dispatchertimer_Tick(object sender, EventArgs e)
        {
            try
            {
                #region test

                //List<TerminalConnectionSettings.ServerProtocols.ReportInfo.CIPCInfo.Client> clientlist = new List<TerminalConnectionSettings.ServerProtocols.ReportInfo.CIPCInfo.Client>();
                //List<TerminalConnectionSettings.ServerProtocols.ReportInfo.CIPCInfo.Connection> connectionlist = new List<TerminalConnectionSettings.ServerProtocols.ReportInfo.CIPCInfo.Connection>();
                //clientlist.Add(new TerminalConnectionSettings.ServerProtocols.ReportInfo.CIPCInfo.Client(1000, "ohohoh", 2000, "192.168.11.1", 60));
                //clientlist.Add(new TerminalConnectionSettings.ServerProtocols.ReportInfo.CIPCInfo.Client(1000, "ohohoh", 2000, "192.168.11.1", 60));
                //connectionlist.Add(new TerminalConnectionSettings.ServerProtocols.ReportInfo.CIPCInfo.Connection(200, 1000));
                //TerminalConnectionSettings.ServerProtocols.ReportInfo reportinfo = new TerminalConnectionSettings.ServerProtocols.ReportInfo(new TerminalConnectionSettings.ServerProtocols.ReportInfo.CIPCInfo(clientlist, connectionlist));
                //TerminalConnectionSettings.CommandEventer messagereader = new TerminalConnectionSettings.CommandEventer();

                //messagereader.ReportInfo += messagereader_ReportInfo;
                //messagereader.Handle(reportinfo.Data);

                //System.Text.Encoding enc = System.Text.Encoding.UTF8;
                //byte[] sendBytes = enc.GetBytes(reportinfo.Data);
                //string str = enc.GetString(sendBytes);

                #endregion

                text1.Text =
                    "工程名    : " + System.Diagnostics.Process.GetCurrentProcess().ProcessName + "\n"
                    + "現在時刻   : " + DateTime.Now.ToLongTimeString() + "\n"
                    + "使用ポート数 : " + rhServer.host_num + "\n"
                    + "制御用ポート : " + Definitions.REMOTEHOSTSERVER_PORT + " ■■ ターミナル用ポート : " + Definitions.TERMINALCONNECTION_PORT;
                char[]   sepalater = { '\n' };
                string[] strs      = this.debugwindow.DebugLog.Split(sepalater, StringSplitOptions.RemoveEmptyEntries);
                this.TextBlock_Status.Text = strs[strs.Length - 1];

                if (rhServer.Num_Port != this.old_Num_Port)
                {
                    rhServer.Listupdate(LISTVIEW1);
                }
                this.old_Num_Port = rhServer.Num_Port;
            }
            catch (Exception ex)
            {
                while (true)
                {
                    myDialog dialog = new myDialog(ex.Message);
                    if (dialog.ShowDialog() == true)
                    {
                        break;
                    }
                }
            }
        }