gpt4 book ai didi

c# - 浏览器控件中刷新和导航功能的区别?

转载 作者:太空宇宙 更新时间:2023-11-03 21:44:00 26 4
gpt4 key购买 nike

昨天我遇到了一个用于显示“浏览量”(即访问该页面的人数)的网站。当我单击刷新按钮时,计数开始增加。

然后我编写了这个小应用程序来增加观看次数。

 browser = new WebBrowser();
for (int index = 0; index < 250000; index++)
{
{
browser.Navigate("url");
System.Threading.Thread.Sleep(100);
}
}

我报告了这个错误,他们已经纠正了它。现在即使我按下 F5 按钮,观看次数也不会增加。但是当我运行上面的程序时,次数开始增加..

谁能解释一下 Navigate 函数和 Refresh(F5) 之间的区别?

最佳答案

Navigate

Loads the document at the specified Uniform Resource Locator (URL) into the WebBrowser control, replacing the previous document.

Refresh

Reloads the document currently displayed in the WebBrowser control.

A document refresh simply reloads the current page, so the Navigating, Navigated, and DocumentCompleted events do not occur when you call the Refresh method.

注意:链接用于浏览器控制,但我认为它们的信息是有效的

关于c# - 浏览器控件中刷新和导航功能的区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17963824/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com