Original: http://www.cnblogs.com/txw1958/archive/2012/09/24/CSharp-WebBrowser.html0. Common methods1Navigate (stringurlstring): Browse urlstring-represented URLs2 Navigate (system.uri URL): Browse URLs represented by URL3Navigate (stringURLString,stringTargetframename,byte[] PostData,stringadditionalheaders): Browse urlstring represented URLs and send messages in PostData4 //(usually when we log in to a website, we send the username and password as postdata.)5 GoBack (): Back6 GoForward (): Forw
"). Style;Directly executes script functions in the page, with dynamic parameters or without parameters.New object[1];objarray[0] = (Object)this. Labflightnumber.text; WebBrowser1.Document.InvokeScript ("ticketbook", Objarray); WebBrowser1.Document.InvokeScript ("return False");Auto-click, Auto-SubmitHtmlElement Btnadd = doc. getElementById ("adddiv"). Firstchild;btnadd.invokemember ("click");Automatically assign a value, and then click the Submit button if there is a script error or a problem t
When we were doing collection software
It is very troublesome for some websites to analyze html text directly.
When WinForm is used for programming
There is a better way, of course, to analyze HtmlDocument
However, this HtmlDoucment cannot be created directly.
It must be generated by the WebBroswer control Navigate after a page
To obtain wb. HtmlDocument
Then, you can analyze the elements and labels of HtmlDocument.
In fact
Not only a single page is collected
In this way, it can be completed in
IntroductionWant to give yourself before the Web novel crawler update, has been written in WinForm form of the program, so this update intends to change the UI to WPF (because I heard that WPF is beautiful), and by the way to introduce WPF learning.Then as a web crawler, the most important thing is to get the HTML source, the usual way to obtain a few: HttpWebRequest, WebRequest, WebClient, WebBrowser and so on. Because I wrote here crawler software f
Description: There is more than one way to implement thread synchronization. In this case, the event was used, and the thread was aborted in the event handler (mainly to answer a friend's question in the CSDN forum). Built a QQ technology Group C #,. NET Technology Exchange Group 242497960 Welcome everyone to join the group "C #, click Link. NET Technology Exchange Group ": Http://jq.qq.com/?_wv=1027k=ON45Ii0, Common methodsNavigate (string urlstring): Browse URLString-represented URLsNavigate
Did a WinForm project. The WebBrowser control is used in the project. It used to be thought that WebBrowser is directly called the system comes with the ie,ie is to render what kind of page WebBrowser on what kind of page. Not really. My WinForm program loads a Web project. This project is not very good for IE8 browser layout compatibility. This machine is using
C # WebBrowser force to open in this window, disable opening in new window
Sometimes it is necessary to load URLs with WebBrowser to implement certain functions. At this point, we do not want to open the link in the page, open in a new window, because so, in fact, with the system default browser open, and thus out of your webbrowser, it can not be controlled by
1. It is generally necessary to implement this sentence: Webbrowser1.scripterrorssuppressed = true;The main goal is to disable the JavaScript error dialog box, otherwise it will cause the program not to run correctly. The downside is clearly that some real JavaScript errors are obscured. But in practice it is felt that in most cases this sentence is necessary.2. Parsing the DOMThe WebBrowser control provides some methods for parsing the DOM, such as W
Perfect solution for webbrowser script errors
. When the IE browser encounters a script error, a yellow icon will appear in the lower left corner of the browser. You can click to view the detailed information about the script error, and no pop-up error message box will appear. When we use the webbrowser control, an error message box is displayed, which shows unfriendly programs and suspends some automatical
Use webbrowser to completely solve web printing problems (including background printing)
How do we solve the problem of printing under the BS architecture? I recently worked on a project to take charge of this part, not only requiring printing specific parts of the page, but also requesting batch printing in the background, I checked some information online and finally solved the problem. With the idea of "serving the public and serving the public", I
Since vs2005, The webbrowser control provided by vs has been quite friendly and highly controllable.
Winform works with webbrowser for UI development. It is also a very smooth mode. Microsoft vs ide installation programs are basically in this mode.
When using webbrowser for UI, we sometimes do not want the link to be clicked by users, do not want to pop up an ann
Webbrowser control disables hyperlink redirection, Script Error prompt, default right-click menu, and shortcut key
Since vs2005, The webbrowser control provided by vs has been quite friendly and highly controllable. Winform works with webbrowser for UI development. It is also a very smooth mode. Microsoft vs ide installation programs are basically in this mode.
E
Due to restrictions of the Microsoft webbrowser control, HTTPOnly Cookies cannot be obtained by using webbrowser. Document. Cookie.
Solution: the expanded csexwb webbrowser control is used. The csexwb webbrowser control supports HTTP header monitoring. This gives us a way to read HTTPOnly cookie data,
Officia
1. The first problem is to shield the right-click menu of the browser,Use the following code to allow the browser to use its own right-click menu:TempBrowser. ContextMenuStrip = this. contextMenuStrip1;TempBrowser. IsWebBrowserContextMenuEnabled = false;
However, unfortunately, the above Code does not work on some machines and started to think that it is an environment or rogue plug-in problem. It has been suffering for a long time and failed. the net upgrade to 4.0 solved this problem, probably
Say with the WebBrowser class, finally do not have to manually encapsulate the SHDOCVW axwebbrowser this ActiveX control. This class if only as a and IE browser, it is too boring (or rather than directly with IE). So, whether we want to do a "custom version of IE", or want to use HTML to do the user interface (refers to WinApp rather than webapp. Many stand-alone software, including the Windows Help Support Center, is HTML-enabled, all without the int
1. Insert a webbrowser Control nameOle_webbrowser2. Write a button to open the webpage.Ole_webbrowser.object.navigate ("www.baidu.cn ")3. Insert a ListBox control4. Write a button to get the linkInt I, countString ls_link []Count = ole_webbrowser.object.document.getelementsbytagname ("A"). Length// MessageBox ('', string (I ))For I = 0 to count-1Ls_link [I + 1] = ole_webbrowser.object.document.getelementsbytagname ("A"). Item (I, 1). getattribute ("hr
1. Insert a WebBrowser control nameOle_webbrowser2, write a button to open the Web pageOle_webbrowser.object.navigate ("www.baidu.cn")3. Insert a ListBox control4, write a link to get the buttonint I,countString ls_link[]Count = Ole_webBrowser.object.Document.getElementsByTagName ("A"). lengthMessageBox (', String (i))For i = 0 to Count-1Ls_link[i+1] = ole_webBrowser.object.Document.getElementsByTagName ("A"). Item (i,1). getattribute ("HREF")NextFor
Encounter an incomparable pit father, plus egg pain lactic acid problem. From the last night to find a bug, to solve the problem this afternoon, the majority of days of time. It takes a long time to find a problem, the solution is simple, but the formation of the solution is a very tangled process.Background: WebBrowser Gets the verification code on the page, and then resolves the captcha back to the page. Parsing and writeback are no problem, the mai
Registration form:+ bit:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\main\featurecontrol\feature_browser_emulationValue Key:yourapplication.exeA bit:Hkey_local_machine\software\wow6432node\microsoft\internet Explorer\main\featurecontrol\feature_browser_ EMULATION值 说明10001 (0x2711) Internet Explorer 10。网页以IE 10的标准模式展现,页面!DOCTYPE无效10000 (0x02710) Internet Explorer 10。在IE 10标准模式中按照网页上!DOCTYPE指令来显示网页。Internet Explorer 10 默认值。9999 (0x270F) Windows Internet Explorer 9. 强制IE9显示,忽略!DOCTYP
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.