Results 1 to 3 of 3

Thread: newbie help: read a text file from a web server

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2011
    Posts
    4

    newbie help: read a text file from a web server

    HEllo
    Am new to VB (my version is 2008 express edition), and want to create an app in vb to connect to a web server, read the text file from it, and display the content in a label or textbox. Anyone can guide me on this?

  2. #2
    New Member
    Join Date
    Jun 2011
    Posts
    2

    Re: newbie help: read a text file from a web server

    this is an old vb6 code ........not sure if it helps.........................

    Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
    On Error Resume Next
    Dim Data As String
    Text1.Text = Text1.Text + Replace(Data, Chr(0), "*") & vbCrLf & vbCrLf
    End Sub

  3. #3

    Thread Starter
    New Member
    Join Date
    Jun 2011
    Posts
    4

    Re: newbie help: read a text file from a web server

    thanks, found one for vb2008:

    Code:
    Dim versionno As String
            Dim objWebClient As New System.Net.WebClient
            Dim objUTF8 As New System.Text.UTF8Encoding
    
            versionno = objUTF8.GetString(objWebClient.DownloadData("url/path/to/file.txt"))
            objWebClient.Dispose()
    
            txtVersion.Text = versionno

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