SSIS中用VB创建csv文件编码格式是UTF8,怎样将创建的文件改为ANSI编码格式
如题,在SSIS中用VB创建编码格式为ANSI的csv文件,代码怎样写?VB代码是这样的。
Public Sub Main()
Dim strData As String = Dts.Variables("User::DataOneRow").Value.ToString
Dim filepath As String
Dim d As DateTime
Dim nextDate As DateTime
d = Now
nextDate = d.AddDays(1)
filepath = "C:\Pfile_" + Format(d, "yyyyMMdd") + "_1630.csv"
Shell("cmd.exe /c echo 2> " + Chr(34) + filepath + Chr(34))
Sleep(1000)
My.Computer.FileSystem.WriteAllText(filepath, Val(Format(d, "yyyyMMdd")), True)
My.Computer.FileSystem.WriteAllText(filepath, ";", True)
My.Computer.FileSystem.WriteAllText(filepath, Val(Format(d, "HHmmss")), True)
My.Computer.FileSystem.WriteAllText(filepath, ";", True)
Dts.TaskResult = ScriptResults.Success
End Sub
End Class
结果生成的csv文件编码格式是UTF8。怎样才能让生成的csv文件编码格式为ANSI?
--------------------编程问答-------------------- 高手在哪里~~
补充:.NET技术 , VB.NET