webbrowser-control

WebBrowser Threads don't seem to be closing

筅森魡賤 提交于 2019-12-22 17:57:23
问题 I am using WebBrowser to render javascript on webpages to scrape the rendered source code, but after several page loads, the CPU usage spikes to 100% as well as the number of threads. I'm assuming that the threads are not closing properly once the webpage has been rendered. I am trying to open the browser, extract the source code, and then close the browser and move to the next page. I am able to get the rendered page, but this program doesn't make it very far before getting bogged down. I

Reentrancy was detected

左心房为你撑大大i 提交于 2019-12-22 14:41:03
问题 I'm getting "Reentrancy was detected" MDA error while setting a webbrowser control's properties. This only happens if I call "SetWindowsHookEx" to hook some dials within the same thread. Normally this hooking code works fine but it doesn't play nice with Webbrowser Control. When I ignore the exception code works fine, at least look like fine but obviously I'm a bit worried. Is there any idea why exactly this error is happening and how to resolve the problem. I've seen this article in MSDN -

C# WebBrowser component ignores window.location.href = url

我只是一个虾纸丫 提交于 2019-12-22 13:58:54
问题 I'm trying to make asp.net mvc application to be shown in c# webbrowser component. Everything works fine except file downloading. In this mvc application there is a lot of side components, so there was found no other way to handle downloadFileLink but to use following JS: function downloadButtonClick(s, e, buttonID, actionUrl) { var downloadUrl = actionUrl + '?FileID=' + s.GetRowKey(e.visibleIndex); if (e.buttonID == buttonID) { window.location = downloadUrl; } } this approach works fine

Open webbrowser with specific url in WP7

▼魔方 西西 提交于 2019-12-22 12:15:57
问题 How would i go about opening the webbrowser with a specific url on button click. 回答1: Put the following code in the button Click event handler: var task = new Microsoft.Phone.Tasks.WebBrowserTask { URL = uri }; task.Show(); 回答2: with this code on button handler event you can navigate to the url assigned to var URL WebBrowserTask wbTask = new WebBrowserTask(); var URL = "http://create.msdn.com"; wbTask.Uri = new Uri(URL, UriKind.RelativeOrAbsolute); wbTask.Show(); 来源: https://stackoverflow.com

Windows phone - Avoid scrolling of Web browser control placed inside scroll viewer

↘锁芯ラ 提交于 2019-12-22 11:25:02
问题 I have to show a web browser inside a scroll viewer in windows phone application, with these requirements : Web browser height should be adjusted based on its content . Web browser scrolling should be disabled , ( when user scrolls within web browser, scrolling of scroll viewer should take place ) Web browser can do pinch-zoom and navigate to links inside its content. How can I implement that? Any links or samples is greatly appreciated. 回答1: I'm using code like this. Attach events to the

Tracking down a AccessViolationException in WPF

旧城冷巷雨未停 提交于 2019-12-22 11:16:27
问题 I've written a WPF application that uses many Frame controls to view camera feeds. When deployed, it crashes pretty randomly (anywhere from 2 hours to 16+ hours), and I see these in the event log, consecutively: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg) at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame) at System

How to programmatically answer “Yes” to WebBrowser control security alert

拥有回忆 提交于 2019-12-22 10:53:24
问题 I am using WebBrowser control to programmatically access a single website, but whenever I login, I receive this certificate security alert: Since I trust that website and since I need to programmatically automate the login as well, this dialog box gets in the way. I searched SO for a solution and found a question similar to mine, but the accepted answer does not work! I defined a static member in the form that contains the WebControl: public static bool ValidateServerCertificate(object sender

Deleting cookies in WPF web browser control

两盒软妹~` 提交于 2019-12-22 10:45:11
问题 I am developing a WPF application in which I am working with twitter API. To show twitter authentication page I am using WPF web-browser control. I am able to login and use twitter API successfully. My problem is that I need to clear web browser's cookies to implement logout functionality. Is there any way to clear session cookies in WPF web browser? 回答1: Check the following, http://social.msdn.microsoft.com/Forums/en/wpf/thread/860d1b66-23c2-4a64-875b-1cac869a5e5d private static void

Spellcheck in web browser control not working under IE11 emulation

让人想犯罪 __ 提交于 2019-12-22 08:07:12
问题 I am trying to have spellcheck work in a Winforms web browser control. This is my current C# code: try { String appname = Process.GetCurrentProcess().ProcessName + ".exe"; RegistryKey key = Registry.LocalMachine.OpenSubKey("Software\\Microsoft\\Internet Explorer\\Main\\FeatureControl\\FEATURE_BROWSER_EMULATION", RegistryKeyPermissionCheck.ReadWriteSubTree); object ieVal = key.GetValue(appname, null); MessageBox.Show(ieVal.ToString()); if (ieVal == null || (int)ieVal != 11001) { key.SetValue

Any workaround to get text in an iFrame on another domain in a WebBrowser?

混江龙づ霸主 提交于 2019-12-22 06:56:05
问题 You will probably first think is not possible because of XSS restrictions. But I'm trying to access this content from an application that hosts a WebBrowser , not from javascript code in a site. I understand is not possible and should not be possible via non hacky means to access this content from javascript because this would be a big security issue. But it makes no sense to have this restriction from an application that hosts a WebBrowser . If I'd like to steel my application user's