How can I read text from a text file in dropbox?

ODxT

Estimable
Feb 23, 2015
2
0
4,520
I have tried solutions from many other threads but they do not seem to work.
I am using Visual Studio 2013.
This is my code:


Imports System.Net

Public Class Form1

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim myWebClient As New System.Net.WebClient
Dim file As New System.IO.StreamReader(myWebClient.OpenRead("https://www.dropbox.com/s/hvkx5zoqxs5ddjb/Version.txt"))
RichTextBox1.Text = file.ReadToEnd()
file.Close()
End Sub
End Class


But I always get it back as the html document, please let me know what I have done wrong.

 
Solution
This is expected - you are asking WebClient component to retrieve a page, it does not care that the URL looks like a text file, and DropBox promptly serves that page.

So, you either have to parse the HTML for what you need, or master DropBox API