Visual Studio inserts invalid characters in batch files

后端 未结 5 712
我在风中等你
我在风中等你 2020-12-13 08:05

I\'ve got some batch files that I use to help automate the process of creating and reloading development databases. It makes sense to create and maintain these batch files

5条回答
  •  情深已故
    2020-12-13 08:54

    While this was useful in my quest to solve the issue in Visual basic, the solution is to tell VB to use ASCII encoding as shown below:

    Try
            outFile = My.Computer.FileSystem.OpenTextFileWriter(myPath, True, System.Text.Encoding.ASCII)
            outFile.WriteLine(macroText)
            outFile.Close()
     Catch ex As Exception
    

提交回复
热议问题