VBeginner
VBeginner

Reputation: 15

Copy text from website

So, I've been saving a .txt file from a website and using...

My.Computer.FileSystem.ReadAllText()

To put it into a string. But I figured it'd be more efficient to just grab it directly. How do I go about this?

Thank you.

Upvotes: 1

Views: 1308

Answers (1)

SLaks
SLaks

Reputation: 888107

You need to use the WebClient class:

Using wc As New WebClient()
    myString = wc.DownloadString(someUrl)
End Using

Upvotes: 2

Related Questions