|
-
Jul 28th, 2004, 01:29 PM
#1
Thread Starter
New Member
xml download agent
Hi,
I'm trying to design designing a small VB6 Windows program that will download XML from the internet. I'd like it to run quietly in the background (possibly as a Windows service) and poll a web server every few minutes to check for new data, and if found, download it to the local filesystem.
Can anyone give me any general advice or tips about the best way to approach this?
Thanks,
Chris
-
Jul 28th, 2004, 01:39 PM
#2
A timer + the Inet control would work fine.
-
Jul 28th, 2004, 02:58 PM
#3
Thread Starter
New Member
Thanks - sounds like a plan.
How could I handle things like proxy settings etc? Can I get the inet control to use the connection settings from IE?
Also, is there an easy way to check if the machine is currently online? I don't want my app to cause loads of, "do you want to connect" dialogs that pop up and annoy the user every time it tries to connect!
-
Jul 29th, 2004, 03:05 AM
#4
Thread Starter
New Member
One more try TTT
-
Jul 30th, 2004, 06:35 PM
#5
Hyperactive Member
There are methods to detect an Internet connection. I believe some people try to ping a few known good websites, like Google, Microsoft, etc. I've never had a need for this before so I'm not much help there.
Also, instead of retrieving the whole file, you may want to consider using the Winsock control to get just the file header. Most webservers will send the Last Modified info along with what the document is, etc. If it is a large file this would greatly reduce the amount of bandwith you would be sucking up by downloading the entire document every few minutes.
VB.NET 2005 Express with .Net 2.0
C# 2010 .Net 4.0
-
Jul 31st, 2004, 04:15 AM
#6
Fanatic Member
To check for the existence of an Internet connection, check out the InternetGetConnectedState API. To download the file, you can also use the URLDownloadToFile API instead of the Inet/Winsock control. Then you won't have to distribute extra references.
Author for Visual Basic Web Magazine
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|