|
 |
|
|
You are here: Tech Blog
|
Register Login |
|
 |
Creating Text Files with My.Computer.FileSystem.WriteAllText
|
|
 |
|
Location: Blogs All Things Tech |
 |
| Posted by: host |
12/29/2006 5:50 PM |
Today I was having trouble with a simple text file receiving 3 characters at the beginning of the file. After checking to make sure none of my output strings contained the characters, I started checking the methods use to write the file. Sure enough, I had forgotten to change the default encoding (Encoding.UTF8) to Encoding.ASCII. After changing my method parameters, the file came out clean and ready to use.
Example code: My.Computer.FileSystem.WriteAllText("c:\myfile.csv", content.ToString, False, System.Text.Encoding.ASCII)
|
|
| Permalink |
Trackback |
|
|
|
|
|
|

|
 |
Other things you might like...
|
|
 |
|
|
|
|
|

 |
All Things Tech... Mostly
|
|
 |
|
|
|
|
|

 |
Blog Search
|
|
 |
|
|
|
|
|

 |
All Things Tech... Mostly
|
|
 |
|
|
|
|
|

|
|
|
|
|
|
 |
|
|
|
|