Threading - Interact With WebBrowser Object

Feb 23, 2011

So I am currently using the method of combining a timer with a WebBrowser control to constantly check if some particular text has appeared in the WebBrowser control on my form. The text is dynamically generated after some arbitrary amount of time depending on the user's internet connection speed. (I'm using DOM to do this). The code to check for the HtmlElements lies within a function, which is turned called by the timer.

I find that this is kind of crappy and occasionally lags the UI interface, if not making the entire program behave sluggishly. I have been thinking of just using a simple while loop in a worker thread to take care of the issue, but I understand that new threads cannot interact with the UI thread directly (including controls); they have to call wrappers that are present within the UI thread.

So my question is, can you declare a WebBrowser control and still interact with its HTMLDocument properties if you declare it within a worker thread? I don't want the while loop to be executed within the UI thread (by using a wrapper), since that would defeat the purpose. I would also like to avoid DoEvents() as much as possible...unless that's the only way to do this thing?

View 8 Replies


ADVERTISEMENT

VS 2008 UI Threading - Move/interact With Both Forms While The Loop Is Running ?

Oct 17, 2009

When it comes to threading. I've managed to adapt one of JMcIllhinney's backgroundworker codebank examples to somewhat suit my needs, but not completely. I have a main form, and a second form that appears while I'm running through a for loop. It informs the user what is currently happening. I set up a backgroundworker that allowed me to continue to use the main form during the for loop, but the other "status" form was completely frozen, and any labels or graphics were shown as white boxes. I am struggling to figure out how to be able to move/interact with both forms while the loop is running.

View 4 Replies

Create An Object From The Class - Use The Object To Interact With The SQL Db?

Apr 12, 2006

I am developing an IT Asset Tracking application using VB 2005 and SQL Server 2005 Express edition. Will I need to create classes to represent objects such as Computers, Printers, Scanners/Faxes, Contracts, Purchase Orders etc or are there any other approaches.For example, if I am correct, I will have a class called Computer and its properties will include Make,Model,CPU,Hard Disk,Memory etc. Is this the right approach.

Computers can be split up into Desktop PC's, Servers and Notebooks. Would I have to create separate classes for these as well or would they be ok under the Computer class.Once I create an object from the class, how can I use the object to interact with the SQL db.I am a beginner to VB.NET 2005 therefore I am slowly getting to grips with OOP.

View 13 Replies

Webbrowser Control And Threading?

Nov 28, 2009

I am trying to use a webbrowser control to retrieve some information from a couple of websites. ( Login, send some data, click some button. I've created subs for every site i need to login to Then when a button is clicked i called the functions like so:

[Code]...

View 4 Replies

Threading And Object Locking

Mar 22, 2011

I have a problem in a multi-threaded application where I'm getting deadlocked waiting for an object to beocme available.

[Code]...

View 1 Replies

Multi Threading With Comm Object

Jun 20, 2012

We working with a Modem type interface that use's the Comm port for two way communication. The App starts and sets up the Comm port, and sends config info to the 'Modem'. Trick here is you have specific timing issues that need to be considered, and we got it all sorted, by using Threading.

You send The Config command to the modem and wait X ms for the confirmation reply (Single Byte), If no reply, send a Wake up command, wait X ms and send Config command again. Once confirmed that the modem is in config mode, send parameters, Waiting for confirmation of each one. Once config is set, send the 'Return to normal mode' command and wait for confirmation. [Code]

The SwitchModemMode sub runs under the Comms thread and not the main thread, like the Checkmodem sub at the top. Mostly because the Comms thread Raises the Data Event, which in turn calls the SwitchModemMode. Now because of that the Thread that is supposed to be checking for the input and setting the Flag, is actually the one waiting for the Flag to be set. And Yes App.DoEvents could solve it here, however that can/will mess with the Timing needed with these commands. I'm looking for how to pass the Raised event to the Main thread.

View 1 Replies

Threading - Baton Object That Routines Can Pass Around?

Feb 20, 2011

This will no doubt sound like a pretty dumb question to some, but, despite having written many useful single-thread apps over the years, I don't understand enough about threading yet.

Consider this scenario:

There are four modules, each on its own thread, that can happily run concurrently most of the time. However, each module occasionally causes a few seconds' intensive disk activity (by design) and it would be more efficient (faster, less fragmentation) if only one module at a time wrote to the same physical drive.

It would be useful to have something like a baton that modules within a given scope can pass around, perhaps dependent on their respective priority levels.

View 2 Replies

Get POSTDATA From Webbrowser Object?

Jun 13, 2012

I understand in previous versions of VB the webbrowser object had a beforenavigate2 event that provided access to the postdata of the webbrowser. I've searched and searched and I think that event was disabled for visual studio 2010.

View 2 Replies

Put WebBrowser Object Into ASP.NET Page?

May 22, 2011

I have a program which opens up a webpage through a WebBrowser object in c#, and does a bunch of operations with it. Now I need to integrate this functionality into my own webpage.

That means that either I need to take the c# code, and somehow make it work in my webpage itself (put in a WebBrowser object, set up event handlers, etc), or I need to somehow have my webpage open this program on my server, fire an event to start, and receive input from it. It is very important for me to use a WebBrowser object (or even WebKit.Net) because there is a lot of javascript, etc on the page that needs to be processed.

View 1 Replies

Filling Forms Using WebBrowser Object

May 9, 2009

I am trying to fill form located here [URL] using web browser control in MS Visual Basic 2008.

View 1 Replies

How To Convert String To URI For WebBrowser Object

May 27, 2007

I'm reading a string from a text file, and want to use that string as the URL for my web browser object. The error I get is it needs to be URI, but I am completely lost on how to make a string into URI.

View 3 Replies

Looking At Certificate Properties From Webbrowser Object?

Mar 22, 2010

Is there a collection or property somewhere to determine the certificate properties that is in used with the current browser?

If I right-click on the browser object on the VB form, I can see the properties and see the certificates, etc. But is there a way to programatically get to that point? Not seeing anything clearly marked. Not sure if it isn't exposed or if I'm just not seeing it.

View 1 Replies

C# - Using A WebBrowser Or WebKit.Net Object In A Windows Service?

May 24, 2011

I'm trying to create a windows service that loads a website, navigates it, and pulls some information using javascript. This is all very easy to do in a windows forms application, but isn't working in a webservice (apparently because services can't access the registry WinInet Not Supported for Use in Services). Any ideas how to get it to work? Here's my code that outputs nothing:

[Code]...

EDIT: I need a WebBrowser or WebKit.Net object because I need to execute javascript on the page, and I need to maintain a login (using cookies and post data). If there's another method to do this please let me know.

View 1 Replies

Copy Selected Text Out Of A WebBrowser Object?

Sep 3, 2006

is there a way to copy selected text out of a WebBrowser object? I tried:

Webbrowser.Select()
Clipboard.SetDataObject(Webbrowser)

View 9 Replies

Get A WebBrowser Object Not To Download Flash And Images?

May 17, 2009

I am currently trying to get a WebBrowser object not to download flash and images. This is just to make a lightweight browser. I know this can be done within the IE settings, but i would prefer it on an application level.

Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
WebBrowser1.Navigate(New Uri("http:google.co.uk"))
End Sub
End Class

I have found some C# code, but i dont know how to change it to VB.Net and the convertors make some bugs, which i do not know how to fix

Software i am using:

Windows XP SP3
Microsoft Visual Studio 2005

getting the webbrowser to stop downloading them?

View 3 Replies

Set Webbrowser Object To Check Link Address?

May 3, 2010

How I do set the webbrowser object to check the link address I have clicked and if the link is within the host I approved?

View 2 Replies

WebBrowser Object Inherit Any Local Restrictions?

Jun 23, 2011

I'm currently thinking up a program I can sneak onto my computer at work, and it all hinges on one key question...Does the WebBrowser Object inherit any local restrictions? EG, If Facebook is blocked on IE/Chrome would it be blocked on the WebBrowser Object?

View 2 Replies

Click On A Link Which Is In A Drop Down Menu Using WebBrowser Object?

Feb 22, 2012

I am using this code to automate tasks. I got this code from this link which is by Xiaoyun Li - MSFT.

Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
' Part 1: Use WebBrowser control to load web page[code].....

The following is the source code of the Page Actions link in the website. How do i indiacate this in the code so that i can click it automatically?

<a role="button" href="javascript:;" title="Create a child page or peer page, print the page, move the page, or download the page as an HTML file." tabindex="-1">Page Actions</span></a>

The following is the source code of the Download Page link, which is in a drop down menu when clicked Page Actions Button. I can succesfully click this Download Page link, but only when its Parent button(Page Actions) is clicked.make it 100% automated.

<td class="dijitReset dijitMenuItemLabel" colspan="2" dojoattachpoint="containerNode" id="dijit_MenuItem_20_text">Download Page</td>

View 1 Replies

Invoking Onmousedown Action Of Object In WebBrowser Control

Aug 21, 2009

I need to trigger the onmousedown property of a table contained on a web page presented in the WebBrowser control of my form.The site is a nested frames mess, but in this particular frame the tables are basically used to create large, context buttons. In other words, you click the table and are navigated to a subform.[code]At first I thought this might be handled by using InvokeMember("click"), but that has no effect. If I try InvokeMember ("onmousedown") I receive a javascript error on the page. Can anyone tell me if/how one invokes the onmousedown property of an object inside of the WebBrowser control?

View 4 Replies

Open Generated WebPage With WebBrowser Object In Program?

Oct 16, 2011

I'd like to know if it possible to show HTML page created in VB using WebBrowser object without using files on disk.That is, create HTML file in memory and show it within WebBrowser object.

View 3 Replies

Save Or Output WebBrowser Object Context To PDF File

Mar 10, 2010

I am loading an html page into a WebBrowser object in a VB.NET Windows Forms application. The user may make changes to textboxes, dropdowns, etc. on the HTML page displayed in the browser. I want the ability to save the current context to a .pdf file on the local HD. I am able to print using WebBrowser.Print(), which shows the current context, but what ways are possible to get this saved as a PDF file locally?

View 2 Replies

VS 2005 : Get The Current Web Page's Source In .net's Webbrowser Object?

Mar 26, 2009

In VS2005, how could you get the current web page's source in VB.net's webbrowser object? I need to load a webpage up, and then grab everything out of the header and body tags, and then I want to replace some text inside of those tags, and then reshow the page with the updated source.

View 1 Replies

WebBrowser - Late Bind Object/property Names?

Aug 13, 2010

There are issue with using WebBrowser late bind calls related to object/property names generation.For example:

WebBrowser1.Document.DomDocument.Forms.Myform.mycontrol.Value = "test"

will fail with more than one instance of the WebBrowser control.what actually happen is that mycontrol object become Mycontrol and compiled vb.net application will fail with error


Member not found. (Exception from HRESULT: 0x80020003 (DISP_E_MEMBERNOTFOUND))
at Microsoft.VisualBasic.CompilerServices.LateBinding.LateGet(Object o, Type objType,
String name, Object[] args, String[] paramnames, Boolean[] CopyBack)[code].....

Same code will work with vb6 app with multiple WebBrowser controls

Edit: This code is comipled with: Option Strict Off

View 2 Replies

Windows Forms Application That Incorporates The WebBrowser Object?

Mar 24, 2010

I have a VB.Net Windows Forms application that incorporates the WebBrowser object.I want to place the input focus/cursor in a textbox after successfully loading a PDF document in the WebBrowser via the Navigate method.I tried to set the focus (TextBox1.Focus) in the DocumentCompleted event handler, but that failed.Or, I should say that the focus does not stay in the textbox.It appears that all processing initiated by the Navigate method is not complete even when the DocumentCompleted event is fired.And, as a result, the input focus is being moved from the textbox for some reason.

I now set the input focus in the ProgressChanged event handler when the CurrentProgress and MaximumProgress event agruments both have values of zero.This is successful, but I want to be sure that I can rely on the values of the event arguments.After I use the Navigate method, the ProgressChanged event is fired 4 times with the following CurrentProgress and MaximumProgress event argument values: 0 of 10000, 10000 of 10000, 10000 of 10000 (again), and finally 0 of 0.Can I confidently rely on a ProgressChanged event at the absolute end of a successful WebBrowser navigation that has CurrentProgress and MaximumProgress both set to 0?

View 1 Replies

Disable Any Mouse Click (left & Right Buttons) On A WebBrowser Object?

Apr 1, 2011

how i can disable completely mouse and keyboard input on a WebBrowser object using Visual Basic 2008 i have this code:

Dim CarImp
As
New DirectoryInfo("C:VSEPRN")
If CarImp.Exists =

[code]....

i generate a small HTML file on a hard disk, put the AxWebBrowser2 object navigate to the file, all works fine, but i need to diable all user interface on that object. If the user clicks on object, the page reloads completely and i need to avoid that behavior.

View 2 Replies

HtmlElement From A WebBrowser Object Strips Double Quotes From HTML?

Mar 1, 2010

I am grabbing an HTMLElement from a browser object and then using getElementById to grab the element I want. When the element is grabbed into the HtmlElement object double quotes around attributes like <input type="checkbox" name="test1" /> becomes <input type=checkbox name=test1>.It is removing the double quotes and backslash from the HTML available in the HtmlElement. Is there anyway to get the HTML element from Visual Basic .NET code and keep the true HTML formatting?

View 1 Replies

Possible To Spoof Referrer Of A Webbrowser Object That Is Posting Data To A Server?

Aug 14, 2010

Is it possible to spoof the referrer of a webbrowser object that is posting data to a server? I would change to WebRequests, but this needs to be done via a browser.

View 2 Replies

Html - Simulating The Web Client/web Server Interaction In A Winform Using A Webbrowser Object?

Aug 6, 2009

Simulating the web Client/web server interaction in a winform using a webbrowser object in vb2005.net

In short I'm using the web browser object as a gui for a giant treeview folder list, in the html there is a form that needs to submit to perform the action, del, rename, etc.

How do I make my program catch the submit, process it and spit out the new info out to the webbrowser item in vb2005 winform?

View 1 Replies

Forms :: Interact With Cmd.exe?

Mar 12, 2010

Have a Windows app that needs to interact with a stand alone program that is accessed using cmd.exe. From Windows app, I can execute cmd.exe but cannot interact with it. Tried SendKeys, but this only sends one key at a time (sometimes more, but inconsistent) with multiple cmd.exe windows opening. Need to be able to send a whole command (string) to only one cmd.exe window.

View 1 Replies

Interact With Another Program?

Feb 18, 2009

[URL]

I am trying to send keys to another program but i dont know how to write the code to do it and would i have to add a path to the other programs .exe?

View 5 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved