
using System.Net; // Don't forget to include this since it seems like you don't know what you're doing...
WebClient wc = new WebClient();
MessageBox.Show(wc.DownloadString("https://dl.*******userconten*****m/u/12892748/theString.txt"));
Imports System.Net
Public Class Form1
Private WithEvents httpClient As New WebClient
'You need the ?dl=1 at the end of your URL, if you use Dropbo*, otherwise it will return a exception
Private URL As New Uri("https://www.Dropbo*.com/s/7nvdc57pv9wztk9/string.txt?dl=1")
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Try
'Download the string in a different thread
httpClient.DownloadStringAsync(URL)
Catch ex As Exception
'If the download fails, this MessageBox will shown
MessageBox.Show(ex.Message, Application.ProductName + ": An error occured.", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
End Sub
Private Sub httpClient_DownloadProgressChanged(sender As Object, e As DownloadProgressChangedEventArgs) Handles httpClient.DownloadProgressChanged
'The Progress of the downloaded string/file (requires a ProgressBar)
ProgressBar1.Value = e.ProgressPercentage
End Sub
Private Sub httpClient_DownloadStringCompleted(sender As Object, e As DownloadStringCompletedEventArgs) Handles httpClient.DownloadStringCompleted
'If the download is complete, this MessageBox will shown
MessageBox.Show("Download was successfully and is completed." + vbNewLine + "Content of the downloaded string:" + vbNewLine + e.Result,
Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Information)
End Sub
End Class