标签:backgroundworker
-
C#Worker服务与Windows Service - c#
工作者服务项目模板和Windows服务项目模板之间的最大区别是什么,哪个更好使用? 我什么时候可以使用工作者服务和Windows服务? 参考方案 两者都是真实的服务。 Windows服务已经存在20多年了。它们最常在系统启动时启动并永久运行。 Worker Service也是一个真实的过程,但是它旨在作为前端应用程序的后台服务。它从应用程序开始,到应用程序停 […]
-
如何从BackgroundWorker返回列表以在UI线程的下一行代码中使用? - c#
我正在尝试对运行BackgroundWorker进程的应用程序进行编码,该进程执行耗时的操作。在主线程中,计时器更新进度条(这是this question的延续)。但是,此代码不显示MessageBoxes。在foreach (String word in this.words)事件处理程序中的SearchButton_Click行上设置断点将显示this. […]
-
检测到跨线程操作? - c#
我正在使用BackgroundWorker Thread的应用程序上工作。我有一个按钮单击事件,正在执行以下操作 btnLocate_Click(Object sender, EventArgs e) { BackgroundWorker bw = new BackgroundWorker(); bw.DoWork += bw_DoWork; bw.RunW […]
-
在C#中完成了BackgroundWorker2_RunWorker中无效的跨线程操作 - c#
我遇到了没有道理的错误。 Cross-thread operation not valid: Control 'buttonOpenFile' accessed from a thread other than the thread it was created on. 在我的应用程序中,UI线程触发backgroundWorker1,当 […]
-
在C#中按名称查找backgroundworker对象 - c#
如何使用背景工作对象的名称查找对象?对于控件,我可以使用Find根据其名称访问控件: Control Control = this.Controls.Find(ControlName, true)[0]; 后台工作人员和/或计时器如何? Controls.Find找不到它们。 c#大神给出的解决方案 这是不可能的,因为没有公共对象可以跟踪对后台工作程序或计时 […]