コード例 #1
0
        public frmMain(ShadowsocksController sc)
        {
            InitializeComponent();

            //初始化QQWry
            var qqwryPath = Environment.CurrentDirectory + "\\qqwry.dat";

            if (qqwry == null && File.Exists(qqwryPath))
            {
                qqwry = new QQWry(qqwryPath);
            }
            controller = sc;

            #region i18N
            if (System.Globalization.CultureInfo.CurrentCulture.IetfLanguageTag.ToLowerInvariant().StartsWith("zh"))
            {
                Text = "Ping测试";
                dgvMain.Columns[0].HeaderText = "地址";
                dgvMain.Columns[1].HeaderText = "IP地址";
                dgvMain.Columns[2].HeaderText = "备注";
                dgvMain.Columns[3].HeaderText = "物理地址";
                dgvMain.Columns[4].HeaderText = "最大Ping值";
                dgvMain.Columns[5].HeaderText = "最小Ping值";
                dgvMain.Columns[6].HeaderText = "平均Ping值";
                dgvMain.Columns[7].HeaderText = "失败次数";
                dgvMain.Columns[8].HeaderText = "下行速度";
                dgvMain.Columns[9].HeaderText = "测速";
                tssStatusLabel.Text           = "当前状态:";
                tssStatus.Text = "准备就绪";
            }
            #endregion

            LoadConfiguration(controller.GetCurrentConfiguration());

            if (dgvMain.Rows.Count <= 5)
            {
                foreach (var row in dgvMain.Rows)
                {
                    var t = new Thread(Ping)
                    {
                        IsBackground = true
                    };
                    t.Start(row);
                }
            }
            else
            {
                ChangeStatus("Busy...");
                var t = new Thread(Go)
                {
                    IsBackground = true
                };
                t.Start(dgvMain.Rows);
            }
        }
コード例 #2
0
        public frmMain(ShadowsocksController sc)
        {
            InitializeComponent();

            //初始化QQWry
            var qqwryPath = Environment.CurrentDirectory + "\\qqwry.dat";
            if (qqwry == null && File.Exists(qqwryPath)) qqwry = new QQWry(qqwryPath);
            controller = sc;

            #region i18N
            if (System.Globalization.CultureInfo.CurrentCulture.IetfLanguageTag.ToLowerInvariant().StartsWith("zh"))
            {
                Text = "Ping测试";
                dgvMain.Columns[0].HeaderText = "地址";
                dgvMain.Columns[1].HeaderText = "IP地址";
                dgvMain.Columns[2].HeaderText = "备注";
                dgvMain.Columns[3].HeaderText = "物理地址";
                dgvMain.Columns[4].HeaderText = "最大Ping值";
                dgvMain.Columns[5].HeaderText = "最小Ping值";
                dgvMain.Columns[6].HeaderText = "平均Ping值";
                dgvMain.Columns[7].HeaderText = "失败次数";
                dgvMain.Columns[8].HeaderText = "下行速度";
                dgvMain.Columns[9].HeaderText = "测速";
                tssStatusLabel.Text = "当前状态:";
                tssStatus.Text = "准备就绪";
            }
            #endregion

            LoadConfiguration(controller.GetCurrentConfiguration());

            if (dgvMain.Rows.Count <= 5)
            {
                foreach (var row in dgvMain.Rows)
                {
                    var t = new Thread(Ping) { IsBackground = true };
                    t.Start(row);
                }
            }
            else
            {
                ChangeStatus("Busy...");
                var t = new Thread(Go) { IsBackground = true };
                t.Start(dgvMain.Rows);
            }
        }
コード例 #3
0
 private void frmMain_FormClosing(object sender, FormClosingEventArgs e)
 {
     qqwry = null;
     GC.Collect();
 }
コード例 #4
0
 private void frmMain_FormClosing(object sender, FormClosingEventArgs e)
 {
     qqwry = null;
     GC.Collect();
 }