随便记一下,C#并行环境操作Winform的代码段

1 TaskScheduler uiScheduler = TaskScheduler.FromCurrentSynchronizationContext();
2 Task.Factory.StartNew(() => {
3     txtLog.Text=DateTime.Now.ToString();
4     txtLog.ScrollToEnd();
5 }, CancellationToken.None, TaskCreationOptions.None, uiScheduler);
原文地址:https://www.cnblogs.com/sam-snow-v/p/14953647.html