Imports System.Net
Imports System.IO
Module Test
Sub Main()
Dim sURL As String
sURL = "http://msdn.microsoft.com%22
Try
Dim objNewRequest As WebRequest = HttpWebRequest.Create(sURL)
Dim objResponse As WebResponse = objNewRequest.GetResponse
Dim objStream As New StreamReader(objResponse.GetResponseStream())
Console.WriteLine(objStream.ReadToEnd())
Catch eUFE As UriFormatException
Console.WriteLine(eUFE.Message)
Catch eWEB As WebException
Console.WriteLine(eWEB.Message)
Catch e As Exception
Console.WriteLine(e.ToString)
End Try
End Sub
End Module
2009年11月2日 星期一
從URL讀取網頁
標籤:
小技
訂閱:
張貼留言 (Atom)
沒有留言:
張貼留言