Create WebClient class. : WebClient « Network Remote « VB.Net

Create WebClient class.

Imports System.IO
Imports System.Net
Imports System.Text
Imports System.Collections.Specialized
Public Class MainClass
    Public Shared Sub Main()
            Dim client As New WebClient()
            Dim pageData As [Byte]() = client.DownloadData("")
            Dim pageHtml As String = Encoding.ASCII.GetString(pageData)

            client.DownloadFile("", "page.htm")
            Dim form As New NameValueCollection()
            form.Add("MyName", "MyValue")
            Dim responseData As [Byte]() = client.UploadValues("", form)
    End Sub
End Class


Related examples in the same category

1.WebClient Class
2.WebClient.Credentials gets or sets the network credentials