Does Vb.net read text from a .txt web file and display it in a text box?

I am trying to read a small amount from an Internet .txt file and show it in a text box, but with no result ...

These systems are imported:

Imports System.IO Imports System.Text Imports System.Net 

Here is the reading file code:

 Dim address As String = "http://www.url.com/text.txt" Dim client As WebClient = New WebClient() Dim reply As String = client.DownloadString(address) TextBox2.Text = reply 
+4
source share
1 answer

Try this instead:

 Dim address As String = "http://www.stackoverflow.com" Dim client As WebClient = New WebClient() Dim reader As StreamReader = New StreamReader(client.OpenRead(address)) Textbox2.Text = reader.ReadToEnd 
+8
source

Source: https://habr.com/ru/post/1481813/


All Articles