Chạy 1 Thread mới C#
Khai báo
--------------------------------
private Thread autostart;
-------------------------------
Code khi không đưa biến vào hàm
------------------------------------------------------------------------------------
autostart = new Thread(new ThreadStart(RunAuto)); // Hàm RunAuto
autostart.Start();
------------------------------------------------------------------------------------
Code khi hàm cần đưa biến vô
------------------------------------------------------------------------------
autostart = new Thread(() => RunAuto(0, 0, 0, 1, 2));
autostart.Start();
autostart.Join();
---------------------------------------------------------------------------------
Thread autostart2 = new Thread(() => { StartAuto(0, GetWindowTitle(processlisttit[1].Id), 0, 1, 2); });
autostart2.Start();
Đăng nhận xét