Results 1 to 6 of 6

Thread: xml download agent

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2004
    Posts
    3

    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

  2. #2
    Frenzied Member Jmacp's Avatar
    Join Date
    Jul 2003
    Location
    UK
    Posts
    1,959
    A timer + the Inet control would work fine.

  3. #3

    Thread Starter
    New Member
    Join Date
    Jul 2004
    Posts
    3
    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!

  4. #4

    Thread Starter
    New Member
    Join Date
    Jul 2004
    Posts
    3
    One more try TTT

  5. #5
    Hyperactive Member
    Join Date
    Sep 2000
    Location
    NJ, USA
    Posts
    326
    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

  6. #6
    Fanatic Member TheVader's Avatar
    Join Date
    Oct 2002
    Location
    Rotterdam, the Netherlands
    Posts
    871
    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

    My articles on the Web Browser Control:
    Using the Web Browser Control & Using the DHTML Document Object Model

    The examples referenced in the articles can be found here:

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width