webbrowser-control

Multiple accounts to a website application

南笙酒味 提交于 2019-12-12 18:02:03
问题 I have an WindowsForms application written in C# which starts a number of threads for logging in on a site with different users' accounts. I use a WebBrowser control to navigate from the login page to the main page. My problem is I can only authenticate with one user account, all threads are connected to the same account because the site uses cookies to store a sessionID. How can I store multiple sessions to simulate the authentication from different browsers? Any suggestions are welcome. 回答1

How to make WebBrowser complete navigation when running in a headless unit test?

折月煮酒 提交于 2019-12-12 15:34:52
问题 We have a WPF application that loads some content in a <WebBrowser/> control and then makes some calls based on what was loaded. With the right mocks, we think we can test this inside a displayless unit test (NUnit in this case). But the WebBrowser control doesn't want to play nicely. The problem is that we never receive the LoadCompleted or Navigated events. Apparently this is because a web-page is never "Loaded" until it is actually rendered (see this MSDN thread). We do receive the

WP7 WebBrowser control headers

*爱你&永不变心* 提交于 2019-12-12 13:44:42
问题 HI, is possible to add request headers in WP7 WebBrowser control? 回答1: There is no way to do this. If you need to change headers you'll need to use HttpWebRequest . You could intercept the requests from the WebBrowser control and make them yourself via HWR but this could get complicated very quickly. 回答2: No - I don't think there's any API hook available for this. It's a similar problem to the "change the user agent" request discussed in Bring back mobile version of website in WebBrowser

Printing In Landscape mode from a WebBrowser control?

假如想象 提交于 2019-12-12 12:45:57
问题 System.Windows.Forms.WebBrowser wb = new System.Windows.Forms.WebBrowser(); wb.DocumentStream = new FileStream("C:\a.html", FileMode.Open, FileAccess.Read); while (wb.ReadyState != WebBrowserReadyState.Complete) { Application.DoEvents(); } wb.Print(); I know how to set the page orientation from a PrinterDocument object, but not from a WebBrowser object. Any way to do this? Thanks! 回答1: First, I recommend you to use async event model: wb.DocumentCompleted += wb_DocumentCompleted; private void

C# WebBrowser control save web page as image, redirect issue

筅森魡賤 提交于 2019-12-12 12:27:59
问题 I am using the web browser control in a console application, it is created programatically. It gets passed a url and saves the page as an image file using DrawToBitmap. It seems to work fine for many URLs but not for some, including www.google.co.uk where it saves a blank page. IBM.com and microsoft.com work, think it might have something to do with the site doing a redirect. This is the code: int width = -1; int height = -1; // Load the webpage into a WebBrowser control WebBrowser wb = new

WebBrowser control that can handle HTTPS

半世苍凉 提交于 2019-12-12 12:27:08
问题 I am searching for a substitute of the WebBrowser control in .NET which can handle HTTPS. This question is similar here on Stack Overflow, but none of these controls offer HTTPS. btw, just to mention, I tried all these GeckoFx - development stopped Se7en - this is actually continued GeckoFx Webkitdotnet - no one replying on forum but none of them support HTTPS, so I'm kind of stuck here :/. Also, to mention, WebBrowser control that comes with .NET framework works just fine with HTTPS, but the

Catch DragEnter and DragDrop events on webbrowser

南笙酒味 提交于 2019-12-12 11:28:24
问题 I have TreeView, ListView and WebBrowser controls. I use the drag and drop method. With the TreeView and ListView everything works, because they have Dragdrop and DragEnter event. But I did not find them in WebBrowser. I try using: webBrowser1.Document.Body.Drag += new HtmlElementEventHandler(WebBrowser_Drag); webBrowser1.Document.Body.DragOver += new HtmlElementEventHandler(WebBrowser_DragOver); webBrowser1.Document.Body.DragEnd += new HtmlElementEventHandler(WebBrowser_DragEnd); webBrowser1

WebBrowser control does not work with some javascript constructs

这一生的挚爱 提交于 2019-12-12 11:24:39
问题 i have found that WebBrowser control (both Winforms and WPF) has certain javascript constructs not supported especially when they are rendered using showModalDialog / showModelessDialog calls.... This is easily reproducible... 1) Create a test html page such as C:\Temp\Test.htm with this code.. <input type=button onclick="showModalDialog('C:\\Temp\\Test.htm');" value="Show Me as Modal Page." /> <BR /> <a href="javascript:alert('I am shown.')"> I should work using href. </a> <BR /> <a href="#"

Save webpage using webbrowser control

。_饼干妹妹 提交于 2019-12-12 10:10:48
问题 I am using VB6 and the webbrowser control to navigate to to webpages. I want to save the pages I visit in regular intervals without any manual intervention. I know how to parse HTML using DOM. But also need to save the pages without dispaling any dialog box. Is this possible? Will appreciate some help. Thanks. Tawfiq. 回答1: This Microsoft KnowledgeBase article (Q244757) says there's no way to do this with the Web Browser control, but gives an alternative solution using UrlMon.dll, which I've

What is the best WebBrowser control that allows one proxy per instance?

此生再无相见时 提交于 2019-12-12 09:11:20
问题 I am making a multi-threaded [workers] application. Each thread should have it's own Non-GUI WebBrowser that Navigates to a web page and writes data to fields and click a button. I also need each WebBrowser to have it's own proxy. I tried the classic Windows.Forms.WebBrowser but I got stuck at the proxy part as it depends on IE global settings which won't work in my case. Any recommendations are welcome. note: I tried doing it through HttpWebRequest/Response but it will never work as the data