豢螳...
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