C#:停止循环直到事件发生
我有一个 for 循环,里面有一个浏览器的导航方法。它应该加载不同的站点,但问题是它将开始加载 1 个站点,在加载它之前,它会加载另一个站点。所以我需要暂停它直到它完成。
当 ProgressChanged 事件达到 100% 时,我开始编写一个事件......比我想象的我不知道下一步该做什么,但我认为这是一个开始。 请帮忙,谢谢!
编辑:正如罗兰所说,我正在使用表单。
I have a for
loop and inside there is a navigate method for a browser. and it's suppose to load diffrent sites, but the problem is that it will start to load 1 site and before it will load it, it'll load another site. so I need to like pause it until it's completed.
I started to write an event to when the ProgressChanged event is at 100%.. than I figured I don't have any idea what to do next but I think it's a start.
Please help, Thanks!
Edit: I am using Forms as Roland said.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我假设您正在进行 Windows 窗体编程。您想要的事件是 DocumentCompleted 这里是一个例子:
对于 URI 列表来说,这很简单。
I assume you are doing windows forms programming. The event you want is DocumentCompleted Here's an example:
For a list of URIs it's straight forward.