|
-
Jun 23rd, 2011, 03:04 AM
#1
Thread Starter
New Member
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?
-
Jun 23rd, 2011, 08:42 AM
#2
New Member
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
-
Jun 24th, 2011, 07:25 AM
#3
Thread Starter
New Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|