Login  
Search All Forums
Dart Home | PowerTCP Web for ActiveX | Custom Development Reply | PowerTCP Web for ActiveX Topics | Forums   
AuthorForum: PowerTCP Web for ActiveX
Topic: VB.net multithreading
yellowbus

From: warrington, United Kingdom
Posts: 3
Member Since: 08/25/04
posted August 25, 2004 9:38 PM

Hi,

I've read a lot about .net and multithread on the forum however I'm posting this because I can't find an exact example that will help me.

Basically I've wrote a VB6 app that uses the web tool to vist a set of URL's to see if the content is the same as the last time I visited it.

I've now upgraded this app to .net and changed the code and it works great.

However I've just added multithreading to the situation to make the whole thing run a lot quicker and what happens is this:

I have a class which does the web page download
I create multiple instance of the class
Each class gets given a different URL to look at

Once I issue the .get method, that class just sits there doing nothing.

I'm using timeout=0 and running a little do loop to check the status of the http object.

As above basically it sits there with the status being 1.

Any ideas more than welcome!

Thanks in advance,

Mike,
Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted August 26, 2004 4:15 PM

The Web control uses WININET.DLL and Microsoft recommends not using it in ASP. Maybe that warning has something to do with threading?

This is not something we have tested.

If all you need to do is check the content status, you may want to consider switching to our Sockets for .NET product. The TCP component operates in its own thread and it's a trivial thing to write a Web request (provided that cookies or logging in aren't involved)
yellowbus

From: warrington, United Kingdom
Posts: 3
Member Since: 08/25/04
posted August 26, 2004 5:42 PM

Hi,

Hmmmm....basically what I'm doing is I have a list of URL's in a SQL database and what I need to do is visit each url in turn using VB (or hopefully vb.net), copy just the "text" of the web page and store this in the SQL server.

Then I need to revisit that page each day and again get just the "text" of the web page, then compare it to see if its different so I actually need to download the raw html of the web page. I then simply strip the html tags to leave me with the page content.

This is a pretty slow thing to do which is why I thought of multi threading. so I could download multiple pages at the same time.

Would the sockets control offer me this functionality?

Thanks,

Mike,
Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted August 26, 2004 7:20 PM

Yes, definately. You would have to write about 20 lines of code to do the request and get the response.

If you get it, let me know an I can send you some sample code that does an HTTP request.
yellowbus

From: warrington, United Kingdom
Posts: 3
Member Since: 08/25/04
posted August 27, 2004 3:54 AM

Hi,

I've downloaded the sockets connection.

If you could show me the code which would download the raw html of a web page by giving the control a url, I'll give it a go.

If it works I've already had the go ahead to purhchase it :o)

Ta,

Mike,
Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted August 27, 2004 8:51 AM

The program is one I wrote awhile ago to allow me to save any url to a file. It uses the Secure TCP component from Ssl Sockets for .NET but if you don't need HTTPS then you can use regular Sockets for .NET and change the reference and comment out the errors you get when you compile.

Here is link:

http://support.dart.com/downloads/saveurl.zip
Reply | PowerTCP Web for ActiveX Topics | Forums   
This site is powered by PowerTCP WebServer Tool PowerTCP WebServer for ActiveX