我在 C# 中的 Windows 窗体应用程序有问题在这个应用程序里面有一个选项卡式浏览器。现在我想在一个循环中(我做一些操作来计算下一个 url)我可以在 AddTab 之间添加一个延迟。
IE
foreach(Urls url in Links){
// Do something with url
if(url.Host == "google"){ //if host is google until start the
// next AddTab i would wait 5 SEC
addTab(url);
//Here i Tried to use Sleep Thread , While(TimeCur-TimePre) {} but i always
// get Freezing and the other Tabs dont continue the loading
Wait 5 Seconds in somehow
}
}
正如我所写的,我不想使用线程睡眠,因为它会冻结我的表单应用程序。我已经使用了 TimeCur-TimeSaved+(x Second) 的时间技巧,但这也会冻结表单。
我看到很多人们说要使用计时器的话题,所以我尝试使用它们(没有任何结果,也许我错了)
我可以在这个循环中添加什么来延迟 AddTab 之间的打开而不冻结任何东西?