-
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
-
A timer + the Inet control would work fine.
-
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!
-
-
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.
-
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. :)