webbrowser-control

WebBrowser control - enter and keep offline mode

情到浓时终转凉″ 提交于 2019-12-12 02:26:58
问题 I would like to manually load HTML into a web browser control and make sure it does not create any internet traffic, so just show the content to the best of its abilities. As specified in MSDN, WebBrowser.IsOffline is read-only. Is there a way to set it (without using reflection hacks)? Or do I have to resort to using a 3rd party control for this: The most complete C# Webbrowser wrapper control 回答1: You can set WebBrowser.AllowNavigation to False . Whether the control can navigate to another

Embedded IE browser: how to detect redirect before navigation completes?

妖精的绣舞 提交于 2019-12-12 02:14:55
问题 I am hosting an OAuth page in an embedded browser. I want to close the login page as soon as possible without waiting for the redirect page to load (the OAUth provider requires a valid redirect url). How do I detect navigation to the redirect url? OnBeforeNavigate fires for one url, but OnNavigateComplete for the final url, and it (obviously) takes time to navigate and load the page. I would prefer to skip that step by detecting redirect and bailing out before the browser actually hits the

Uploading Files Not Working - trim the initial characters

你说的曾经没有我的故事 提交于 2019-12-12 02:12:41
问题 I am trying to upload a file using the WebBrowser control. It trims the starting character sometimes one and sometimes three then choose window gives error Invalid file name! . Can't seem to do it and need some help. Here is the Html: <input name="UploadedFile" id="UploadedFile" type="file" /> <input name="up" id="up" type="button" value="Upload" /> Here is the vb code: Dim el = elc.GetElementsByName("UploadedFile") el.Item("UploadedFile").Focus() ' SendKeys.Send("Capture.png" & "{ENTER}")

System.OutOfMemoryException unhandled exception?

a 夏天 提交于 2019-12-12 01:53:12
问题 I'm working on a C# project for windows phone 8 that plays selected youtube videos.My app has 1 page, which has 3 Grids (1 for each of 3 States). Video Selection Menu (where I have an ItemsControl which has around 80-100 grids inside, where each of those grids has 2 textblocks, 1 image and a button inside them) Video Details Menu (Shows more info about the video the user selected on the "Video Selection Menu" and has a play button which gets you to the third State). Video (has a webbrowser

Assigning user agent String to web browser Control

人走茶凉 提交于 2019-12-12 01:47:58
问题 Is there any possibility of assigning user agent string to web browser control in winforms or wpf? for example i have 3 different web browser controls and each would have different user agent string? 回答1: check this out Changing the user agent of the WebBrowser control 来源: https://stackoverflow.com/questions/5193553/assigning-user-agent-string-to-web-browser-control

How to Embed jQuery in a WinForms app to Use in a WebBrowser Control

十年热恋 提交于 2019-12-12 01:43:30
问题 I would like to use jQuery in a WinForms WebBrowser control, but without getting access to jQuery via a link to a url (i.e. I want to embed jQuery in my app and get it from there). Is there a way to do that? If so, how does it need to be embedded (e.g. as a Content file) and what's the html to use it? 回答1: It seems pretty straight forward. Just grab the file, load it into a script element, and then add that to the DOM. Here is how I would approach it: Download it from here : https://code

Using WebBrowser to automate filling in an AngularJS form

两盒软妹~` 提交于 2019-12-12 01:41:35
问题 I am using WebBrowser to automate filling in a textbox, on a website that uses AngularJS. This is the HTML on their website <input name="email" type="email" placeholder="Email address" ng-model="login.email" autofocus="" class="ng-pristine ng-valid ng-empty ng-valid-email ng-touched" aria-invalid="false"> This is my C# code webBrowser1.Document.GetElementsByTagName("input").GetElementsByName("email")[0].SetAttribute("value", _login); That populates the input box, but I don't think it updates

Using Google Webfonts in Windows Phone 8 web browser control

不问归期 提交于 2019-12-12 01:29:25
问题 I am trying to use web fonts in my Windows phone application. From the comments I have read, I understood that it is not possible to use fonts embedded into XAP file. So, I am trying to open a webpage that contains Google Web Fonts which is at: http://omercelik.com/e.htm When I open this page from Internet Explorer on phone, it shows the font correctly. But when I try to load this page from a webBrowser control, it doesn't loads this page. I don't do anything else but this on my app: private

WebBrowser ID Access - not in DocumentText but in Page Source

…衆ロ難τιáo~ 提交于 2019-12-11 23:29:49
问题 I am using the WebBrowser object, for web automation purposes on a windows form .Net Framework 4.5 application. In a certain page, I am not able to see the id in my WebBrowser.DocumentText even though I can see it when I open View page source from an actual browser. This is the code that I always use to get the HtmlElement inside a page. var attack = wb.Document.GetElementById("target_attack"); To sum up how can I retrieve an ID that is not inside DocumentText but inside the page source ?

Building a document with text and images from streams

别等时光非礼了梦想. 提交于 2019-12-11 23:23:38
问题 I would need to display certain images and text in c# WinForms application, so I decided to use WebBrowser. Both images and text are retrieved from the database. However, I don't know how to combine them in the document creation. Thank you! 回答1: Besides nobugz's suggestion, you can implement IMoniker on an object that exposes your data as mht (web archive) and use IE document's IPersistMoniker interface to load from your object. http://www.codeproject.com/KB/miscctrl/csEXWB.aspx is an example