webbrowser-control

Caching and the WebBrowser control in .Net

雨燕双飞 提交于 2019-12-03 06:57:41
I'm using the WebBrowser control in .Net to execute some 3rd party affiliate marketing conversions. I have a queue table in a database with all the scripts/images to execute. I loop through all these in a WinForms app with the WebBrowser control. After I've executed a script/image I Dispose the WebBrowser control, set it to null, and renews it with a new WebBrowser control instance. Consider this URL: http://renderserver/RenderScript.aspx?id=1 RenderScript.aspx displays an Image with a URL of e.g.: http://3rdparty/img.ashx?id=9343 I use Fiddler to see all requests and responses, and when the

How to Highlight a specific word in WebBrowser control C#

时光毁灭记忆、已成空白 提交于 2019-12-03 06:31:44
I have a webbrowser control and I am able to get the selected word by the user. I am saving this word in a file and with it I am also saving its byte offset and length. Lets says i have some text in my Web browser control as "Hello Hey Hello" lets say the user has selected last hello. Now that word is saved with me along with other info like its length etc. I need to provide a feature to highlight the selected word when the user reloads the file and sends me that word along with its length and byte offset Is there any way to do it. you're going to need to import the Microsoft.mshtml assembly

MSIEs WebBrowser control hosted in winforms app runs in compatibility mode

浪尽此生 提交于 2019-12-03 06:25:40
I'm hosting MSIE in a winforms form. Unfortunately it insists on running in compatibility mode regardless of if I give it a page that runs in IE8 mode in stand-alone IE. The effect of that is that some content that renders correctly in stand-alone MSIE gets completely mis-aligned and messed up in the hosted control. Besides document type etc, is there some magic way to tell the webbrowser that I want it to render the page the same way as if I loaded it in stand-alone MSIE? I don't want to use the registry key override ( http://blogs.msdn.com/b/ie/archive/2009/03/10/more-ie8-extensibility

Getting webbrowser cookies to log in [duplicate]

让人想犯罪 __ 提交于 2019-12-03 06:02:30
问题 This question already has answers here : Is it possible to transfer authentication from Webbrowser to WebRequest (9 answers) Closed last year . I am creating an windows forms app, where I have a webbrowser control . After user logs in with the webbrowser , I want to log in also with same account with Microsoft.Http.HttpClient or HttpWebRequest or similar, it should be similar to cURL from PHP . Problem is that the webpage allows only single sign on per account and if I sign with HttpClient,

Can I detect errors while using a .Net WebBrowser control?

倾然丶 夕夏残阳落幕 提交于 2019-12-03 05:46:44
I have an .Net Froms application that displays web pages through a WebBrowser control. Is there anyway that I can detect if the control shows a ' Page not found ' or ' Cannot display webpage ' error? There doesn't seem to be any error event handlers. The WebBrowser windows forms control is wrapper around Internet Explorer and it doesn't expose all the functionality of the underlying ActiveX control and particularly the NavigateError event. Here's a workaround: First add reference to SHDocVw.dll to your project (COM tab of Add Reference window). Then you can do the following to capture errors:

WPF Web Browser Control and DPI Scaling

 ̄綄美尐妖づ 提交于 2019-12-03 05:14:54
I'm working with a WPF application that uses the Web Browser control and I'm having issues with High DPI scaling. It looks like the Web Browser control is not properly respecting the DPI settings of the system, while the rest of the WPF application is properly scaling the UI. This means that on higher scale levels the WPF interface gets larger while the Web browser content stays on the original, now smaller looking size. Here's an example of screen captures from a WPF app that uses two Web Browser Controls. 100% Scaling: 150% Scaling: Notice in the second image the Web Browser scaling is much

How to Cleanly Destroy WebBrowser Control

落爺英雄遲暮 提交于 2019-12-03 00:46:07
I am using ATL in VisualC++10 to host browser control. My code is similar to this example: http://msdn.microsoft.com/en-us/library/9d0714y1(v=vs.80).aspx Difference is I have main window and then child window hosts the browser control. After 2 minutes i have to close the browser completely kill the browser activeX but this child window should be alive and do something else. But somehow this browser control still stays there, i can either see scrollbars or something.. I have also tried by creating child window to an existing child window, and at the time of closing browser I then destroy this

How to use proxy with C# application

非 Y 不嫁゛ 提交于 2019-12-03 00:42:47
I am using Microsoft Visual Studio 2010 C# .net 4.0 I have a webbrowser element. What i want to do is navigating via Webbrowser element with using proxy. How can i do that ? thank you. The browser control is just an instance of IE - it will use IE's proxy settings. You can set these by playing with registry keys if you must do it in code. string key = "Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings"; string serverName = "";//your proxy server name; string port = ""; //your proxy port; string proxy = serverName + ":" + port; RegistryKey RegKey = Registry.CurrentUser.OpenSubKey

WebBrowser-Control - open default browser on click on link

偶尔善良 提交于 2019-12-03 00:39:43
I use the WebBrowser-Control in my WPF-Application like <WebBrowser x:Name="webBrowser" Margin="0,28,0,0" /> Now, when I navigate to a mht-page which contains links and the user click on one of this link, the new page is opened in the WebBrowser-Control. But it should be opened in a new Default-Browser-Window. The content in the WebBrowser-Control should not be changed. Is there a way to change this behavior? You can open the new page in default browser using Proces.Start() on Navigating event and set e.Cancel = true; so that the page in the control will not change. Example: @MainWindow.xaml

how to use custom ip address to browse a web page c#/.net

我是研究僧i 提交于 2019-12-02 22:29:31
问题 i am trying to browse web page using custom(user provided) ip address but it's not working. webBrowser1 loads web page successfully but it's not using custom ip address, it loads page with real ip address. please tell me how to make this work successfully. this is my code: private void Form1_Load(object sender, EventArgs e) { IPAddress addr1 = IPAddress.Parse("192.168.1.100"); webBrowser1.ScriptErrorsSuppressed = true; webBrowser1.Navigate("www.whatismyip.com"); } 回答1: You can't change your