[問題] 有關使用Threadpool
使用Threadpool的一些問題, 用:
ThreadPool.QueueUserWorkItem(new WaitCallback(ThreadProc));
執行ThreadProc, 如下:
static void ThreadProc(Object stateInfo) {
Console.WriteLine("Hello from the thread pool.");
}
我想問一下, 為什麼一定要用static?
為什麼ThreadProc看不到Form1裡面的物件? 像Text或Button之類的, 謝謝~
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 123.194.233.126
推
03/12 22:54, , 1F
03/12 22:54, 1F
→
03/12 22:56, , 2F
03/12 22:56, 2F
推
03/14 20:44, , 3F
03/14 20:44, 3F