示例#1
0
        private static void PostPerform()
        {
            TimeData now = TimeData.Now();

            _info.Time最終更新 = now;
            _info.Time次回更新 = null;

            if (_client.Flag失敗)
            {
                _info.Count失敗++;
            }
            else
            {
                _info.Count失敗 = 0;
            }

            _info   = null;
            _client = null;

            {
                int countMax = -1;

                foreach (Gnd.ClientInfo info in Gnd.ClientInfos)
                {
                    countMax = Math.Max(countMax, info.Count失敗);
                }

                Gnd.ErrorIconFlag = Gnd.Count失敗Min_ChangeIcon <= countMax;
            }
        }
示例#2
0
        private void BtnOk_Click(object sender, EventArgs e)
        {
            // 登録
            {
                Gnd.ClientInfo info = new Gnd.ClientInfo();

                info.Url =
                    "http://ieserver.net/cgi-bin/dip.cgi?username="******"&domain=" +
                    this.DomainName.Text +
                    "&password="******"&updatehost=1";

                info.HeaderFields.Add(new string[]
                {
                    "User-Agent",
                    "DDnsClient"
                });

                Gnd.ClientInfoこれ登録してね = info;
            }

            this.Close();
        }
示例#3
0
        private void MS_SetRow(int rowidx, Gnd.ClientInfo info)
        {
            DataGridViewRow row = this.MainSheet.Rows[rowidx];
            int             c   = 0;

            row.Cells[c].Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
            row.Cells[c].Style.BackColor = Gnd.Color行番号;
            row.Cells[c].Value           = "" + (rowidx + 1);
            c++;

            row.Cells[c++].Value = this.MS_GetCell(info.Method);
            row.Cells[c++].Value = this.MS_GetCellByUrl(info.Url);
            row.Cells[c++].Value = this.MS_GetCell(info.Version);
            row.Cells[c++].Value = this.MS_GetCellByHeaderFields(info.HeaderFields);
            row.Cells[c++].Value = this.MS_GetCellByBody(info.Body);
            row.Cells[c++].Value = this.MS_GetCell(info.BodyEncoding);
            row.Cells[c++].Value = this.MS_GetCell(info.ResBodyEncoding);
            row.Cells[c++].Value = this.MS_GetCell(info.Period);
            row.Cells[c++].Value = this.MS_GetCell(info.Time最終更新);
            row.Cells[c++].Value = this.MS_GetCell(info.Time次回更新);

            row.Cells[c].Style.Alignment = DataGridViewContentAlignment.MiddleRight;
            row.Cells[c].Value           = "" + info.Count失敗;
            c++;
        }
示例#4
0
        private void BtnDoTest_Click(object sender, EventArgs e)
        {
            this.Visible = false;

            Gnd.ClientInfo escInfo = _info;
            _info = new Gnd.ClientInfo();
            this.SaveData();
            ClientData client = new ClientData(_info);

            _info = escInfo;

            using (Form f = new BusyDlg(new ClientData.ClientDataTh(client).End))
            {
                f.ShowDialog();
            }
            using (Form f = new ResultWin(client))
            {
                f.ShowDialog();
            }
            this.Visible = true;
            this.UIRefresh();
        }
示例#5
0
 public ClientData(Gnd.ClientInfo info)
 {
     _info = info;
 }
示例#6
0
        public static void Perform()
        {
            if (_th != null)
            {
                throw null;                          // ? 実行中
            }
            if (Gnd.ClientInfos.Count == 0)
            {
                return;
            }

            TimeData now = TimeData.Now();

            // 毎分00秒前後は避ける。
            {
                int s = (int)(now.T % 60);

                if (s < 5 || 50 < s)
                {
                    return;
                }
            }

            _currClientIndex++;
            _currClientIndex %= Gnd.ClientInfos.Count;
            _info             = Gnd.ClientInfos[_currClientIndex];

            if (_info.Time次回更新 == null)
            {
                if (_info.Time最終更新 != null)
                {
                    TimeData td = new TimeData(_info.Time最終更新.T);

                    switch (_info.Period)
                    {
                    case Gnd.ClientInfo.Period_e.Minute_3: td.T += 180; break;

                    case Gnd.ClientInfo.Period_e.Minute_5: td.T += 300; break;

                    case Gnd.ClientInfo.Period_e.Minute_7: td.T += 420; break;

                    case Gnd.ClientInfo.Period_e.Minute_10: td.T += 600; break;

                    case Gnd.ClientInfo.Period_e.Minute_20: td.T += 1200; break;

                    case Gnd.ClientInfo.Period_e.Minute_30: td.T += 1800; break;

                    case Gnd.ClientInfo.Period_e.Hour_1: td.T += 3600 * 1; break;

                    case Gnd.ClientInfo.Period_e.Hour_2: td.T += 3600 * 2; break;

                    case Gnd.ClientInfo.Period_e.Hour_3: td.T += 3600 * 3; break;

                    default:
                        throw null;
                    }
                    _info.Time次回更新 = td;
                }
                else
                {
                    _info.Time次回更新 = now;
                    //_info.Time次回更新 = new TimeData(now.T + 1L);
                }
            }
            if (now.T < _info.Time次回更新.T)
            {
                return;
            }

            // 実行すること確定!

            _info.Time最終更新 = null;
            _info.Time次回更新 = null;

            _client = new ClientData(_info);

            _th = new Thread(PerformTh);
            _th.Start();
        }
示例#7
0
        public EditWin(Gnd.ClientInfo info)
        {
            _info = info;

            InitializeComponent();
        }