static void Main(string[] args) { Console.WriteLine($"主线程1:{Thread.CurrentThread.ManagedThreadId.ToString()}"); dele.BeginInvoke(CallbackFun, "899"); Console.WriteLine($"主线程2:{Thread.CurrentThread.ManagedThreadId.ToString()}"); Console.ReadKey(); }
private void Form1_Load(object sender, EventArgs e) { mydele = new Mydele(GetText); var s1s = Thread.CurrentThread.ManagedThreadId; mydele.BeginInvoke("2", Callbacs, null); Thread.Sleep(1000); this.textBox1.Text = "call back之前"; var s3s = Thread.CurrentThread.ManagedThreadId; }