zoukankan      html  css  js  c++  java
  • SSIS 脚本任务读取文件

    变量fileName输入参数,读取文件内容放到变量content中。

     1 Public Sub Main()
     2         '
     3         ' Add your code here
     4         '
     5         Dim filename As String
     6         Dim content As StringBuilder
     7         content = New StringBuilder
     8         filename = Dts.Variables("fileName").Value.ToString()
     9 
    10         Try
    11             ' Create an instance of StreamReader to read from a file.
    12             Using sr As StreamReader = New StreamReader(filename)
    13                 Dim line As String
    14              
    15                 Do
    16                     line = sr.ReadLine()
    17                     content.AppendLine(line)
    18                 Loop Until line Is Nothing
    19                 sr.Close()
    20 
    21             End Using
    22 
    23             Dts.Variables("content").Value = content.ToString()
    24 
    25         Catch E As Exception
    26           
    27             Console.WriteLine(E.Message)
    28         End Try
    29 
    30 
    31 
    32         Dts.TaskResult = Dts.Results.Success
    33     End Sub
    34 
    35 
  • 相关阅读:
    BZOJ 1072: [SCOI2007]排列perm
    BZOJ 1071: [SCOI2007]组队
    HDP集群部署
    使用Kubeadm部署kubernetes集群
    Docker 私有仓库
    Docker Compose
    Dockerfile使用
    Docker应用部署(Mysql、tomcat、Redis、redis)
    Docker 容器的数据卷 以及 数据卷容器
    Docker 服务、镜像、容器简单命令使用
  • 原文地址:https://www.cnblogs.com/yg_zhang/p/1313911.html
Copyright © 2011-2022 走看看