webbrowser-control

How can I get source code of page thru WebBrowser-Control (ActiveX InternetExplorer)?

百般思念 提交于 2020-01-02 03:57:21
问题 How can I get source code of page thru WebBrowser Control (ActiveX InternetExplorer)? I have an xml document "foo.xml". var Web: TWebBrowser; begin ... Web.Navigate("foo.xml"); // How can I get source code thru WebBrower control<---- ... end; 回答1: In the DocumentCompleted event, look at the DocumentText property of the WebBrowser control. It should have the complete text of the loaded page. 回答2: IHTMLDocument2(Web.Document).Body.InnerHTML; This should return the source of the page. 回答3: I

AccessViolationException from WebBrowser control with custom IDownloadManager

妖精的绣舞 提交于 2020-01-01 19:16:51
问题 My .NET application hosts a WebBrowser control, and I've attached a custom download manager. Everything seems to work fine except for requests with the following two HTTP headers: Content-Type: application/octet-stream Content-Disposition: attachment; filename=blahblahblah Change or omit the content type header, and everything works fine; it's just application/octet-stream that has the problem. Remove the content disposition header and the download manager isn't used. Interestingly, this

Submission of a webpage form using WebBrowser control in C#

天涯浪子 提交于 2020-01-01 09:58:29
问题 I have seen a lot of posts regarding this particular subject on SO as well as on the web in general and most if not all code is as seen below private void btnSubmit_Click(object sender, RoutedEventArgs e) { webBrowser1.Navigate(new Uri("http://samples.msdn.microsoft.com/workshop/samples/author/dhtml/refs/onsubmit.htm")); } private void btnLogin_Click(object sender, RoutedEventArgs e) { mshtml.HTMLDocument htmlDoc = null; htmlDoc = (mshtml.HTMLDocument) this.webBrowser1.Document; if

Disable scrolling in browser control for WP7?

痞子三分冷 提交于 2020-01-01 05:42:06
问题 Is it possible to disable the scrolling in a web browser control in Windows Phone 7.1? I have seen quite a few questions ask around it (Windows Phone 7.0, Silverlight) but an answer has yet to come up. Any ideas? 回答1: There is a blog post here explaining how to suppress the zoom and scroll functionality of the WebBrowser control. Quote from that post: The visual tree is quite simple, composed of a few grids and borders. The significant parts are the TileHost, which is the native IE9 component

How to call javascript inside a WebBrowser control in winforms?

流过昼夜 提交于 2020-01-01 04:43:06
问题 I want to call the javascript function 'Goto' like this : javascript:Goto('DM_NEW_OBJECT.ASPX?DM_CAT_ID=2063&DM_PARENT_ID=2217&INPUTSELECTION=&DM_OBJECT_ID=0&PACK_ID=0&CASE_ID=0&mode=0&SITE=Default'); the function is located in the DefaultGeneral.aspx page, and i need to call it from within a WebBrowser control webBrowser1.Navigate("http://mySite/DefaultGeneral.aspx"); Do you have any idea ? Thank you. 回答1: Since you are using a WebBrowser object, I will assume that this is actually a Windows

Displaying Print Preview of HTML Document without DocumentViewer

浪子不回头ぞ 提交于 2020-01-01 03:33:19
问题 I have a C#/WPF application in which I need to display a print preview for an HTML document -- essentially just like what one would see if looking at a print preview in Firefox or even IE. I know about DocumentViewer, however, I am trying to stay away from using a DocumentViewer control as it seems to be pretty slow and some of the documents I need to display can be upwards of 450+ pages and I want to load the preview as quickly as possible. Does anyone know of an elegant way of doing

Show an HTML file of my Project in WebBrowser control at run-time

蓝咒 提交于 2019-12-31 06:44:05
问题 I want to show a local html file which exists in my project: The calling file is the HelpFile.cs and in that the form contains the WebBrowser control. The address I'm trying to reach is: C:\Users\Keith\Desktop\Lingerie\Corset\Corset\Bra.html The file is being called from: The result is the dreaded page can't be displayed. What I would like to do is be able to call the file as a relative html page. At a later stage, I would like to be able to call different help files. Is this the best way to

how to pass ip-address to webBrowser control

╄→гoц情女王★ 提交于 2019-12-31 05:12:07
问题 How to pass IPAddress to webBrowser control This is my code but i don't know how to pass ip-address to webBrowser control. IPHostEntry host; string localIP = "?"; host = Dns.GetHostEntry(Dns.GetHostName()); foreach (string line in File.ReadAllLines("proxy.txt")) { IPAddress ip = IPAddress.Parse(line); if (ip.AddressFamily.ToString() == "InterNetwork") { localIP = ip.ToString(); textBox1.Text = ip.ToString(); // This code doesn't work, it's just a hypothetical example: webBrowser1

Suppress about:blank in Print Output of WinForms WebBrowser

谁说我不能喝 提交于 2019-12-30 21:55:11
问题 I'm updating a WinForms application that uses System.Windows.Forms.WebBrowser to output some HTML content generated by the program. The solution works fine, except that about:blank is printed in the footer of each page. Is it possible to suppress that output? Alternatively, is there a straightforward alternative for printing HTML from WinForms that does not have that issue? The client does not want to assume the presence of any third-party software such as Excel or even a PDF reader. 回答1:

How can I make JavaFX web browser displays alert and confirm message

天涯浪子 提交于 2019-12-30 11:12:48
问题 My java web browser don't display alert("message"); and confirm("message"); either, I ussually use c# web Browser component and it's works perfectly but I'm new at this. public void openPage(String url){ JFXPanel jfxPanel = new JFXPanel(); JFrame frame = new JFrame(""); frame.add(jfxPanel); Platform.runLater(() -> { WebView webView = new WebView(); jfxPanel.setScene(new Scene(webView)); webView.getEngine().load(url); frame.setExtendedState(JFrame.MAXIMIZED_BOTH); frame.setLocationRelativeTo