Results 1 to 4 of 4

Thread: Requires VB code for repeating process

Threaded View

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2011
    Posts
    3

    Requires VB code for repeating process

    Hello Friends
    Please help me I am new in developer field & try developing little software I have ( search from net)following code & want to continuous download file after 30 second without Download OK or Error in Download
    vb Code:
    1. Private Declare Function URLDownloadToFile Lib "urlmon" Alias _
    2.     "URLDownloadToFileA" (ByVal pCaller As Long, ByVal szURL As String, _
    3.     ByVal szFileName As String, ByVal dwReserved As Long, _
    4.     ByVal lpfnCB As Long) As Long
    5.  
    6. Private Sub Command1_Click()
    7. ' Note that this file is 2M, so you might want to try with something simpler
    8. Dim errcode As Long
    9. Dim url As String
    10. Dim localFileName As String
    11.  
    12. url = "http://mysite.com/data.csv"
    13. localFileName = "c:\data.csv"
    14.  
    15. errcode = URLDownloadToFile(0, url, localFileName, 0, 0)
    16. If errcode = 0 Then
    17.     MsgBox "Download ok"
    18. Else
    19.     MsgBox "Error while downloading"
    20. End If
    21. End Sub
    Thanks In Advance
    Last edited by Hack; Jul 25th, 2011 at 11:07 AM. Reason: Added Highlight Tags

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