How to delete Webbrowser form data?
I'm using a
system.windows.forms.webbrowser
to login into facebook. When the next user logs in I want the login form to be totally blank and not have the name of the previous 开发者_C百科user in there. How can I do that?
The WebBrowser control stores Web pages from recently visited sites in a cache on the local hard disk. When the control navigates to a page, it saves time by displaying a cached version, if one is available, rather than downloading the page again. Use the Refresh method to force the WebBrowser control to reload the current page by downloading it, ensuring that the control displays the latest version.
You could use JavaScript to do this (Not pretty but it does it in 1-2 lines of code).
The markup below is not correct, it is an example.
WebBrowrower1.Navigate("javascript: void Document(somegetelementbyID/Tagname('').value = '')");
精彩评论