当后台处理正在进行时,如何将值添加到列表框?

发布于 2024-09-16 21:21:45 字数 112 浏览 4 评论 0原文

我正在创建一个应用程序。并且我正在扫描驱动器的文件以搜索特定模式 我的进度条正在更新,最后所有文件名都列在列表框中。我希望一旦发现所有这些文件包含该模式,就立即列出它们。

我正在使用后台工作人员

I am creating an application.and i am scanning files of a drive to search a particular pattern
my progress bar is getting updated and at the end all the file names are listed in the list box.i want the all those files to be listed immediately as soon as its found that they contain the pattern.

I'm using BackgroundWorker

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

纸伞微斜 2024-09-23 21:21:45

结合使用 ReportProgress 方法ProgressChanged 事件。这种场景正是他们的目的。

Use the ReportProgress method in combination with the ProgressChanged event. This type of scenario is exactly what they are intended for.

爱已欠费 2024-09-23 21:21:45

您可以使用后台工作者的 ReportProgress 方法。

http://msdn.microsoft.com/en-us/library/a3zbdb1t。 ASPX

You can use ReportProgress method of background worker.

http://msdn.microsoft.com/en-us/library/a3zbdb1t.aspx

烂人 2024-09-23 21:21:45

您需要实现一个前台工作人员并从后台工作人员调用它。

理想情况下,您会将所有新发现的文件的列表传递给前台工作人员。

You would need to implement a foreground worker and invoke it from the background worker.

Ideally, you would be passing a list of any newly found files to the foreground worker.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文