_ | 覦覈襦 | 豕蠏手 | 殊螳 | 譯殊碁
FrontPage › SSIS-IP煙牡覦鰢企襴覲


' Microsoft SQL Server Integration Services Script Component
' Write scripts using Microsoft Visual Basic 2008.
' ScriptMain is the entry point class of the script.

Imports System
Imports System.Data
Imports System.Math
Imports Microsoft.SqlServer.Dts.Pipeline.Wrapper
Imports Microsoft.SqlServer.Dts.Runtime.Wrapper

<Microsoft.SqlServer.Dts.Pipeline.SSISScriptComponentEntryPointAttribute> _
<CLSCompliant(False)> _
Public Class ScriptMain
    Inherits UserComponent

    Public Overrides Sub PreExecute()
        MyBase.PreExecute()
        '
        ' Add your code here for preprocessing or remove if not needed
        '
    End Sub

    Public Overrides Sub PostExecute()
        MyBase.PostExecute()
        '
        ' Add your code here for postprocessing or remove if not needed
        ' You can set read/write variables here, for example:
        ' Me.Variables.MyIntVar = 100
        '
    End Sub

    Public Overrides Sub 0_ProcessInputRow(ByVal Row As 0Buffer)
        '
        ' Add your code here
        '
        Dim binIP(3) As Byte
        Dim valid As Boolean = False

        If String.IsNullOrEmpty(Row.IP) Then
            valid = False
        ElseIf Len(Row.IP) - Len(Row.IP.Replace(".", "")) <> 3 Then
            valid = False
        Else
            valid = Net.IPAddress.TryParse(Row.IP, Nothing)
        End If

        If valid = True Then
            Row.IsValidIp = True

            binIP(0) = CByte(Row.IP.Split(CChar("."))(0))
            binIP(1) = CByte(Row.IP.Split(CChar("."))(1))
            binIP(2) = CByte(Row.IP.Split(CChar("."))(2))
            binIP(3) = CByte(Row.IP.Split(CChar("."))(3))
            Row.IpBinary = binIP
        Else
            Row.IsValidIp = False
        End If
    End Sub

End Class
蠍 蠍郁鍵..
企: : るジ讓曙 襦螻豺 企Ν 譯殊語. 襦螻豺
EditText : Print : Mobile : FindPage : DeletePage : LikePages : Powered by MoniWiki : Last modified 2018-04-13 23:12:53

磯Μ 蠖 れ る れ 磯Μ襯 螻 磯Μ 企蟆 蟆. 谿曙^ 伎 伎給. 螳 手 伎 蟆 蠏瑚 蠏 豌伎 讀蟇一伎蠍 覓語. れ 讌覃 譴 讌. 蠏碁Μ螻 襾 螻褐 ロ 朱ゼ 螳碁.