webbrowser-control

Use WebBrowserControl Capture Form Post

妖精的绣舞 提交于 2019-12-11 22:58:31
问题 I am working on an Html/Http inspection UI for a specialized system. I am wondering if someone knows how to capture the values of a POST generated inside of a WebBrowserControl from code to trap what values were posted and the location(action) of the post. I am not looking for a tool as Fiddler and Firebug's Net panel both do this beautifully, I am looking for a way to capture and record posts in code from .Net using the WebBrowserControl. Is there a way to do this? Note: My current version

Suppress the “are you sure you want to leave this page” popup in the Delphi TWebbrowser control

こ雲淡風輕ζ 提交于 2019-12-11 22:20:58
问题 I have an Delphi application that uses TWebbrowser component to automate navigation to another web application we have. My problem is that sometimes IE shows the infamous 'Are you sure you want to leave this page' message and when this happens, my app can't navigate to another pages unless an user clicks on 'Leave this page' button. I can't edit the website code to remove this warning, unfortunately. This message is plaguing my app for weeks, and I could not reach to a proper solution anymore

How to get image from WebBrowser control

瘦欲@ 提交于 2019-12-11 22:16:42
问题 I have a WebBrowser control, after navigating a page I need to download the image. I used the following code: HtmlElementCollection tagsColl = webBrowser1.Document.GetElementsByTagName("img"); foreach (HtmlElement currentTag in tagsColl) { ... using (var client = new WebClient()) { ... client.DownloadFile(currentTag.GetAttribute("src"), path); ... } } but, in this case webclient starts a new session, and link in new session is not correct. I need to do this in same session as webbrowser, only

CHtmlView class and focus

Deadly 提交于 2019-12-11 21:51:49
问题 I have an SDI application written in MFC. The frame is divided into 1 row and 2 columns using a splitter window. Below are details of Row and Column (R0C0 means Row#0 and Col#0) R0C0 view is a CFormView with multiple input controls like text box, combo box etc. R0C1 view is a CHtmlView that contains HTML content relavant to the control that has input focus in the R0C0 I am able to update the HTML content and also invoke Javascript functions through my MFC code. Problem: When user clicks on

sendkeys during the apearance of dialogbox

杀马特。学长 韩版系。学妹 提交于 2019-12-11 20:33:32
问题 I need to use sendkeys during the appearance of ShowSaveAsDialog in VB.2010 webbrowser control. But it seemed that it's not functioning because it waits first for the dialog to be closed before it activates. Here is my code: WebBrowser1.ShowSaveAsDialog() Timer1.Enabled = True *in the timer event SendKeys.Send("AAAAAA")<br> SendKeys.Send("{TAB}")<br> SendKeys.Send("{TAB}")<br> SendKeys.Send("{ENTER}")<br> Timer1.Enabled = False I need to send the "AAAAAAA" to the file name but its not working

WebBrowser, handle pdf load complete

狂风中的少年 提交于 2019-12-11 19:39:55
问题 I was wondering if anyone knew an easy way to have .pdf files trigger the readystate when loaded. I'm building a program to open url's and take screenshots, then put them in excel. The web browser will load html documents correctly, but gets stuck in While Not pageready when loading .pdf files. The browser control correctly renders the .pdf . Private Sub btngo_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btngo.Click Dim file As String Dim Obj As New Object Dim

How to solve 'Attempted to read or write protected memory…' error with programmatic approach for WebBrowser component?

谁都会走 提交于 2019-12-11 18:55:49
问题 I have a windows application which uses a form containing WebBrowser component. I never found this error message in the navigate method of it, till OS Vista. But it only shows up for OS Windows 7. Yes, solutions - 1) At post build - call "$(DevEnvDir)....\VC\bin\vcvars32.bat" call "$(DevEnvDir)....\VC\bin\editbin.exe" /NXCOMPAT:NO "$(TargetPath)" 2) editbin.exe /NXCOMPAT:NO YourProgram.exe works for me, but I need a programmatic approach. If any one can help me about it. Thanks in advance...

VB6: get onreadystate value from browser control

久未见 提交于 2019-12-11 18:16:08
问题 i'm trying to get the onreadystate value from the browser control do detect when the page has finished loading. unfortunately the event's .returnValue returns empty. what's wrong? here's my code - thx: Dim WithEvents m_doc As HTMLDocument Private Sub Form_Load() Set m_doc = WebBrowser1.Document End Sub Private Sub m_doc_onreadystatechange() Dim m_event As IHTMLEventObj Set m_event = m_doc.parentWindow.event m_value = "'" & m_event.returnValue & "'" MsgBox "onreadystatechange: " & m_value End

Call winform function from html page?

主宰稳场 提交于 2019-12-11 18:07:40
问题 I have a winform application that contains a c# webbrowser control.Webbrower control load a html page. On that html page I have a button. What I want is when click that button, it will call a winform function(function in Form1.cs for example). Is it possible? Please help me 回答1: Use window.external object in your scripting code to access public properties and methods of the specified object. (See the sample in the link) C# public void Test(String message) { MessageBox.Show(message, "client

Getting around the XSS filter in web browser control

可紊 提交于 2019-12-11 18:03:19
问题 I am working on a pet project and need to overcome a major hurdle in an application. I have checked countless forums and articles and have only found bits and pieces of what I am looking for, so I hope a more direct approach will help me. Here's the scenario: 1. The site is actually a game, which uses Javascript/JSON with DHTML on a page that has several IFRAMES - two of which are deeper inside the outside page AND of a separate domain. There are NO security issues with what I am trying to do