Results 1 to 2 of 2

Thread: Read TXT Line by Line from Website

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2008
    Posts
    113

    Read TXT Line by Line from Website

    I know how to read line by line from a txt file on my computer, but what about reading line by line of a txt file on a website? (www.website.com/example.txt)

  2. #2
    PowerPoster Fazi's Avatar
    Join Date
    Aug 2005
    Location
    Underworld
    Posts
    2,525

    Re: Read TXT Line by Line from Website

    Hia Josh,
    just downlod that file to your Hard Drive and read it as usual.
    Code:
    Private Declare Function URLDownloadToFile Lib "urlmon" Alias "URLDownloadToFileA" (ByVal pCaller As Long, ByVal szURL As String, ByVal szFileName As String, ByVal dwReserved As Long, ByVal lpfnCB As Long) As Long
    Public Function DownloadFile(URL As String, LocalFilename As String) As Boolean
        Dim lngRetVal As Long
        lngRetVal = URLDownloadToFile(0, URL, LocalFilename, 0, 0)
        If lngRetVal = 0 Then DownloadFile = True
    End Function
    Private Sub Form_Load()
        'example by Matthew Gates ([email protected])
        DownloadFile "www.website.com/example.txt", "c:\example.txt"
    End Sub

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