更新时间:2023-02-20 22:18:13
您可以使用BackgroundWorker类,该类简化了后台线程的处理。您正在使用WPF。
网上有很多例子。这是来自codeproject的两个,但是很容易找到更多示例:
You can use the BackgroundWorker class, which simplifies the handling of background threads when you are working with WPF. There are plenty of examples on the web for this. Here two from codeproject, but it's easy to find more examples:
http://www.codeproject.com/Tips/83317/BackgroundWorker-and-ProgressBar-demo.aspx
http://www.codeproject.com/KB/cpp/BackgroundWorker_Threads.aspx