#title * [SSIS - 웹페이지 호출] Imports System.Net Imports System.IO Imports System.Web Imports System.Uri 추가... {{{ vb.net ' Microsoft SQL Server Integration Services Script Task ' Write scripts using Microsoft Visual Basic ' The ScriptMain class is the entry point of the Script Task. Option Strict Off Imports System Imports System.Data Imports System.Math Imports Microsoft.SqlServer.Dts.Runtime Imports System.Net Imports System.IO Imports System.Web Imports System.Uri Public Class ScriptMain ' The execution engine calls this method when the task executes. ' To access the object model, use the Dts object. Connections, variables, events, ' and logging features are available as static members of the Dts class. ' Before returning from this method, set the value of Dts.TaskResult to indicate success or failure. ' ' To open Code and Text Editor Help, press F1. ' To open Object Browser, press Ctrl+Alt+J. Public Sub Main() ' ' Add your code here ' Dim strRs As String Dim url As Uri Dim strMsg As String = "URL Encoding 함수" Dim strURL As String = "http://databaser.net/moniwiki/wiki.php/" + url.EscapeUriString(strMsg).ToString() MsgBox(url.EscapeUriString(strMsg).ToString()) 'strRs = GetWebPageToString(strURL) 'MsgBox(strRs) End Sub Private Function GetWebPageToString(ByVal URL As String) As String Dim webreq As HttpWebRequest = WebRequest.Create(URL) Dim webres As HttpWebResponse = webreq.GetResponse() Dim sr As StreamReader = New StreamReader(webres.GetResponseStream, System.Text.Encoding.UTF8) Return sr.ReadToEnd End Function End Class 'HttpUtility.UrlEncode }}} http://www.sqlleader.com/mboard.asp?exec=view&strBoardID=SS2005QNA&intSeq=3461 {{{ Imports System Imports System.Data Imports System.Math Imports System.Net Imports Microsoft.SqlServer.Dts.Runtime Public Class ScriptMain Public Sub Main() Dim url As String = "http://www.sqlleader.com" Dim wRequest As HttpWebRequest wRequest = CType(WebRequest.Create(url), HttpWebRequest) Dim wResponse As WebResponse wResponse = wRequest.GetResponse() ' 페이지 내용 읽어오기 Dim rSteam As System.IO.Stream = wResponse.GetResponseStream() Dim sReader As System.IO.StreamReader = New System.IO.StreamReader(rSteam) MsgBox(sReader.ReadToEnd()) Dts.TaskResult = Dts.Results.Success End Sub End Class }}}