但是自.Net framework 2.0開始,只要方法不是overloading,compiler都會自行判斷要使用哪個方法建立執行緒,因此直接以一般方法建立即可,如︰
Dim thread1 As Thread = New Thread(AddressOf MyThread); thread1.Start(); Dim thread2 As Thread = New Thread(New ThreadStart(AddressOf MyThread)); thread2.Start(); Dim thread3 As Thread = New Thread(AddressOf MyThreadWithParameter); thread3.Start(myClass); Dim thread4 As Thread = New Thread(New ParameterizedThreadStart(AddressOf MyThreadWithParameter)); thread4.Start(myClass);以上四種方法都是可行的。
Reference:
http://www.cftea.com/c/2012/03/0ELGB9V327N8CCKT.asp
沒有留言:
張貼留言