开发者

VB.NET code for running multiple threads

开发者 https://www.devze.com 2022-12-27 00:25 出处:网络
How to I run multiple threads in VB.NET? Say I need 2 threads - one that prints 100 numbe开发者_StackOverflow中文版rs in a loop and the second one that asks for the user\'s name and prints it inside

How to I run multiple threads in VB.NET?

Say I need 2 threads - one that prints 100 numbe开发者_StackOverflow中文版rs in a loop and the second one that asks for the user's name and prints it inside a message box.


I would use 2 BackgroundWorker objects one for each operation that you want to execute. Using the background workers ProgressChanged event will ensure that you don't need to marshal the results back to the UI as the BackgroundWorker already takes care of this for you.

0

精彩评论

暂无评论...
验证码 换一张
取 消