views:

178

answers:

2
Dim instance As WebClient
Dim address As String
Dim avoids as string

address = "http://www.ecosavetech.com/avoid.txt"

avoids = instance.DownloadString(address)

MsgBox(avoids)

msgbox is not showing anything.

please help! i am not getting any errors either

i am using Imports System.Net

+3  A: 

Are you sure you are not getting any errors? Your code invokes the DownloadString method on a variable that is not referring to an instance (yet). You probably want do create a WebClient as well:

Dim instance As New WebClient()
Dim address As String
Dim avoids As Atring

address = "http://www.ecosavetech.com/avoid.txt"

avoids = instance.DownloadString(address)

MsgBox(avoids)
Fredrik Mörk
+2  A: 

In the code you shared, you didn't actually create the WebClient.

Dim instance as WebClient = new WebClient()
Matt Greer