webbrowser-control

WebBrowser control and cookies

我的未来我决定 提交于 2019-12-23 19:35:06
问题 I have a problem with WebBrowser control and cookies. First of all what happens when one navigates in a normal Web browser (IE9 in my case): 1.1. I open Web page http://www.gmail.com. I enter my username / password, I leave the checkbox " Stay signed in " unchecked and click " Sign in ", IE9 opens my GMail page with all my mails listed. That is OK. 1.2. At the top of GMail page there are a lot of links like "Calendar", "Documents", etc. When I click the "Documents" link, my documents page is

Catch security alert events

让人想犯罪 __ 提交于 2019-12-23 16:59:38
问题 How do I catch the event related to the following webbrower1 security messages: I've try using Navigated , Navigating , DocumentTitleChanged , FileDownload , EncryptionLevelChanged and NewWindow , but without success. 回答1: I've finally find the way to catch these security events by using the following code : Public Class Form1 Dim WebBrowserReady = False Dim securityAlertEvent_1 = False Dim securityAlertEvent_2 = False Private Sub bRunReportID_Click(sender As Object, e As EventArgs) Handles

Get a screenshot of the web browser control?

我是研究僧i 提交于 2019-12-23 10:26:44
问题 There are a lot threads about this but none of them were clear and none I tried actually even worked right. What is the code to get the contents of the entire web browser control (even that which is off screen)? It looks like they did have: webBrowser1.DrawToBitmap(); // but its unsupported and doesnt work 3rd party api - not wasting my time .DrawToBitmap and nonanswer-links 100 wrong answers just takes a screenshot 回答1: I was working on a similiar function in my project last week, read a few

WebBrowser website timeout

痴心易碎 提交于 2019-12-23 09:33:42
问题 This is for a Desktop C# app in Visual Studio Express 2012. I am using a webBrowser control to logon to various websites but find some do not respond and timeout. I suspected it may be the webBrowser control inherently running IE7 but found the websites work fine on an old PC running IE7 as a native browser. Is there something in webBrowser I need to set to allow a website such as the one in the code below to process responses? The code below navigates to a website I am having trouble with.

Supress the “are you sure you want to leave this page” popup in the .NET webbrowser control

断了今生、忘了曾经 提交于 2019-12-23 05:24:07
问题 I have a web browser automation project written in WinForms C#. During the navigation there is a point where the browser does the "are you sure you want to leave this page?" popup. We need this popup, so I cannot remove it from the website code, which means I have to override it in my automation app. Does anyone have an idea how to do this? 回答1: and here was the smooth solution.. add a reference to mshtml and add using mshtml; Browser.Navigated += new WebBrowserNavigatedEventHandler( (object

How do I embed a browser in an Excel VBA form?

和自甴很熟 提交于 2019-12-23 05:11:35
问题 In the past I have used the Microsoft WebBrowser control in many VB6 and Excel VBA forms. I need to do it again, but I can't figure out how to do it. I tried opening an old VB6 project and I got this error message: Line 17: Class SHDocVwCtl.WebBrowser of control WebBrowser was not a loaded control class. I tried adding a reference to Microsoft Web Browser to a new VBA project, but it doesn't exist. I tried adding a reference to msi.dll as suggested here, but didn't help. I tried from the

Specify User Agent for WPF WebBrowser Control

﹥>﹥吖頭↗ 提交于 2019-12-23 04:11:54
问题 I need to alter the default User Agent used by the WPF WebBrowser control. I have looked at the properties of the IWebBrowser2 object behind the control, and tried specifying the user agent by specifying it when calling "Navigate" as Suggested Here Is this possible? 回答1: The solution could be like the following Changing the UserAgent of the WebBrowser control -Winforms C# 回答2: URLMkSetSessionOption. http://blogs.msdn.com/b/ieinternals/archive/2009/10/08/extending-the-user-agent-string

Specify User Agent for WPF WebBrowser Control

ⅰ亾dé卋堺 提交于 2019-12-23 04:10:29
问题 I need to alter the default User Agent used by the WPF WebBrowser control. I have looked at the properties of the IWebBrowser2 object behind the control, and tried specifying the user agent by specifying it when calling "Navigate" as Suggested Here Is this possible? 回答1: The solution could be like the following Changing the UserAgent of the WebBrowser control -Winforms C# 回答2: URLMkSetSessionOption. http://blogs.msdn.com/b/ieinternals/archive/2009/10/08/extending-the-user-agent-string

How can I progmatically click a link in a Winform Web Browser control?

落爺英雄遲暮 提交于 2019-12-23 03:51:46
问题 I would like to know how to programatically click a link from with in a Winform Web Browser control. foreach (HtmlElement linkElement in webBrowser.Document.GetElementsByTagName("A")) { if(linkElement.InnerText == "Helpful Tips") { //Click Functionality } 回答1: You should be able to do this using the InvokeMember method. Something along these lines: linkElement.InvokeMember("Click") 来源: https://stackoverflow.com/questions/3419306/how-can-i-progmatically-click-a-link-in-a-winform-web-browser

NullReferenceException with System.Windows.Controls.WebBrowser WPF

心已入冬 提交于 2019-12-23 03:29:09
问题 I have a C# WPF application with a web browser control (System.Windows.Controls.WebBrowser) called wB. It is supposed to display a local html file, and some information parsed from it. I get the a NullReferenceException as it says body is null in the last line (IHTMLElementCollection data = hDoc.body.children as IHTMLElementCollection) with the following code: wB.Navigate(new Uri(file, UriKind.Absolute)); HTMLDocument hDoc = (HTMLDocumentClass)wB.Document; IHTMLElementCollection data = hDoc