Difference between Refresh and Navigate function in browser control?

非 Y 不嫁゛ 提交于 2019-12-13 18:21:50

问题


Yesterday I came across one of the sites that uses to display the "Views"(i.e.the no of persons visited the page).When I clicked the refresh button the count started increasing.

Then I wrote this small application to increase the view count.

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

I reported the bug and they have rectified it.Now even if I press the F5 button the view count won't increase.But when I run the above program the count starts increasing..

Can somebody explain me the difference between Navigate function and Refresh(F5)?


回答1:


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.

Note: Links are for webbrowser control but I presume their information is valid



来源:https://stackoverflow.com/questions/17963824/difference-between-refresh-and-navigate-function-in-browser-control

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!