public void AddResult(string strUrl) { if (!this.textBox_Result.InvokeRequired) this.textBox_Result.AppendText(strUrl + "\r\n"); else { Delegate_AddResult delegate_addresult = new Delegate_AddResult(this.AddResult); this.textBox_Result.Invoke(delegate_addresult, strUrl); } }
public delegate void Delegate_AddResult(string strUrl);//定义输出结果的委托 public void AddResult(string strUrl) { if (!this.Sessions.InvokeRequired) { this.Sessions.Items.Add(strUrl); } else { Delegate_AddResult delegate_addresult = new Delegate_AddResult(this.AddResult); this.Sessions.Invoke(delegate_addresult, strUrl); } }
public void AddResult(string strUrl) { if (!this.textBox_Result.InvokeRequired) { this.textBox_Result.AppendText(strUrl + "\r\n"); } else { Delegate_AddResult delegate_addresult = new Delegate_AddResult(this.AddResult); this.textBox_Result.Invoke(delegate_addresult, strUrl); } }