사이트 HTML 가져오기

네크 2015.01.08 22:00:03 *: Imports System.Net
Imports System.IO

Public Class Form1

Private Function getHTML(ByVal Address As String) As String
Dim rt As String = ""

Dim wRequest As WebRequest
Dim wResponse As WebResponse

Dim SR As StreamReader

wRequest = WebRequest.Create(Address)
wResponse = wRequest.GetResponse

SR = New StreamReader(wResponse.GetResponseStream)

rt = SR.ReadToEnd
SR.Close()

Return rt

End Function

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

TextBox2.Text = getHTML(TextBox1.Text)

End Sub
End Class

사이트 HTML을 가져오는 명령어 입니다.