Results 1 to 3 of 3

Thread: [RESOLVED]Get Lines Separately[RESOLVED]

Threaded View

  1. #1

    Thread Starter
    Junior Member JustinMs66's Avatar
    Join Date
    Jun 2006
    Location
    CA, USA, EARTH
    Posts
    21

    [RESOLVED]Get Lines Separately[RESOLVED]

    i want to have 1 text file, and that text file will have like:
    myfile1.dll
    myfile2.exe
    myfile3.php

    and i want to be able to access each line separately. because in each line will contain a URL to a file, which will then be downloaded. here is what i have so far:
    my code:
    VB Code:
    1. Private Sub cmdupdatecheck_Click()
    2.     ' download the updates information text file:
    3.     DownloadFile "http://www.csscobalt.com/uploads/updated_files.txt", "c:\updated_files.txt"
    4.        
    5.     ' open the updated_files.txt file
    6.     Dim File1Data, File2Data As String
    7. Open "c:\updated_files.txt" For Input As 2
    8.     Line Input #1, File1Data
    9.     Line Input #2, File2Data
    10.  
    11. 'take the prefix of the know URL and add the file name at the end, creating a complete URL.
    12. Dim File1DataUrl
    13. Dim File2DataUrl
    14. File1DataUrl = "http://www.csscobalt.com/uploads/" & File1Data
    15. File2DataUrl = "http://www.csscobalt.com/uploads/" & File2Data
    16.  
    17. 'make a correct Save Path
    18. Dim File1DataUrlSave
    19. Dim File2DataUrlSave
    20. File1DataUrlSave = App.Path & "upload_files/" & File1Data
    21. File2DataUrlSave = App.Path & "upload_files/" & File2Data
    22.  
    23. 'ACTUALLY Download the file:
    24. DownloadFile File2DataUrl, File1DataUrlSave
    25. DownloadFile File2DataUrl, File2DataUrlSave
    26. Close 2, 1
    27. End Sub
    now NORMALLY, you would have to do:
    DownloadFile "http://www.csscobalt.com/uploads/myfile.php", "c:\myfile.php"
    but i can't do that because i won't know the actual file name.

    and also i know that my line separation of the txt file code is completely wrong... but it's a start.
    can anyone PLEASE help me with this?
    Last edited by JustinMs66; Sep 20th, 2006 at 02:54 PM.

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