/// <summary> /// Test connect click event procedure. /// </summary> private void Button_Connect_Click(object sender, EventArgs e) { // set result to default value .. resultVar = ConnectResult.NONE; // lock controls .. this.FormControls(false); // analysis server address .. IPAddress[] ipadds = Dns.GetHostAddresses(this.TextBox_Server.Text.Trim()); if (ipadds.Length > 0) { // assign ip address .. this.Addr = ipadds[0]; // create therad object .. __Connect = new System.Threading.Thread( new System.Threading.ParameterizedThreadStart(this.Connecting)); // start thread process and timer check .. __Connect.Start(ipadds[0]); __reply.Start(); } else { MessageBox.Show(this.ParseErrMsg, AssemblyInfoClass.ProductInfo, MessageBoxButtons.OK, MessageBoxIcon.Error); // unlock controls .. this.FormControls(true); return; } }
private void comboBox_Server_SelectedIndexChanged(object sender, EventArgs e) { if (this.comboBox_Server.Text.ToString().Trim() != "0.0.0.0") { #region 設定IP、Port顯示 this.NumericUpDown_Port.Value = this.MyServerList[this.comboBox_Server.SelectedIndex].ServerPort; if (this.MyServerList[this.comboBox_Server.SelectedIndex].IsMaster) { this.checkBox_IsMaster.Checked = true; } else { this.checkBox_IsMaster.Checked = false; } #endregion #region 測試是否可鏈接 Test connect click event procedure. // set result to default value .. resultVar = ConnectResult.NONE; // lock controls .. this.FormControls(false); // 獲取地址 analysis server address .. IPAddress[] ipadds = Dns.GetHostAddresses(this.comboBox_Server.Text.Trim()); if (ipadds.Length > 0) { // assign ip address .. this.Addr = ipadds[0]; //創建新的線程鏈接伺服器 create therad object .. __Connect = new System.Threading.Thread(new System.Threading.ParameterizedThreadStart(this.Connecting)); // start thread process and timer check .. __Connect.Start(ipadds[0]); __reply.Start(); } else { MessageBox.Show(this.ParseErrMsg, AssemblyInfoClass.ProductInfo, MessageBoxButtons.OK, MessageBoxIcon.Error); // unlock controls .. this.FormControls(true); return; } } else { MessageBox.Show("未指定的位址"); } #endregion }
public static global::sys.thread._Thread.HaxeThread create(global::haxe.lang.Function cb) { #line 35 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\sys\\thread\\Thread.hx" global::System.Threading.Thread native = new global::System.Threading.Thread(((global::System.Threading.ThreadStart)(new global::sys.thread._Thread.Thread_Impl__create_35__Fun(cb).Delegate))); native.IsBackground = ((bool)(true)); #line 37 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\sys\\thread\\Thread.hx" global::sys.thread._Thread.HaxeThread hx = global::sys.thread._Thread.HaxeThread.allocate(native); native.Start(); #line 40 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\sys\\thread\\Thread.hx" global::sys.thread._Thread.HaxeThread this1 = hx; #line 40 "C:\\HaxeToolkit\\haxe\\std\\cs\\_std\\sys\\thread\\Thread.hx" return((global::sys.thread._Thread.HaxeThread)(this1)); }
public void start() { t.Start(); }