I am using the following powershell script to copy a text file from one location to another and then encode it so that it can be imported using a SQL bulk copy. The source file is encoded as UCS-2 Little Endian.
gc "\\SourceServer\Share\Person.txt" | Out-File -encoding ASCII \\dbserver\share\DataFlag\Person.txt
Can the same action be done in C# without using the powershell script?