Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/assembly/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Http 用于循环下载多个zip文件的SSIS脚本_Http_Download_Ssis_Foreach Loop Container - Fatal编程技术网

Http 用于循环下载多个zip文件的SSIS脚本

Http 用于循环下载多个zip文件的SSIS脚本,http,download,ssis,foreach-loop-container,Http,Download,Ssis,Foreach Loop Container,我有一个SSIS包,其中我使用一个带VB的Scipt任务(见下面的代码)和一个Http连接管理器来下载1个已定义的.zip文件。我希望做的但不明白的是循环下载同一位置的所有.zip文件 如有任何建议,将不胜感激 以下是视觉B: Imports System Imports System.IO Imports System.Text Imports System.Windows.Forms Imports Microsoft.SqlServer.Dts.Ru

我有一个SSIS包,其中我使用一个带VB的Scipt任务(见下面的代码)和一个Http连接管理器来下载1个已定义的.zip文件。我希望做的但不明白的是循环下载同一位置的所有.zip文件

如有任何建议,将不胜感激

以下是视觉B:

    Imports System
    Imports System.IO
    Imports System.Text
    Imports System.Windows.Forms
    Imports Microsoft.SqlServer.Dts.Runtime

     Public Sub Main()
    '
    ' Get the unmanaged connection object, from the connection manager called "HTTP Connection Manager"
    Dim nativeObject As Object = Dts.Connections("HTTP Connection Manager").AcquireConnection(Nothing)

    ' Create a new HTTP client connection
    Dim connection As New HttpClientConnection(nativeObject)


    ' Download the file #1
    ' Save the file from the connection manager to the local path specified
    Dim filename As String = "C:\Users\{CurrentUser}\Documents\file.zip"
    connection.DownloadFile(filename, True)

    ' Confirm file is there
    If File.Exists(filename) Then
        MessageBox.Show(String.Format("File {0} has been downloaded.", filename))
    End If


    ' Download the file #2
    ' Read the text file straight into memory
    Dim buffer As Byte() = connection.DownloadData()
    Dim data As String = Encoding.ASCII.GetString(buffer)

End Sub

使用ForEachLoop容器并用脚本工作所需的信息填充变量。然后访问脚本中的变量。

是否使用循环容器?我将使用foreach循环容器。