# Write ANSI text

#### Nemesis09

##### Active member
Hi,

I'm writing a program which needs to write text to an existing text file, which it does.

The problem I've found now is that the text file hase to use ANSI encoding.

The code I'm using to write to the file is:

VB.NET:
``````[SIZE=2]Microsoft.VisualBasic.FileIO.FileSystem.WriteAllText(Form1.apppath & [/SIZE][SIZE=2][COLOR=#800000]"\employees.dat"[/COLOR][/SIZE][SIZE=2], txtExt.Text & [/SIZE][SIZE=2][COLOR=#800000]","[/COLOR][/SIZE][SIZE=2] & txtName.Text & vbCrLf, [/SIZE][SIZE=2][COLOR=#0000ff]True[/COLOR][/SIZE][SIZE=2],)[/SIZE]
[SIZE=2]``````
[/SIZE]

I've found that this command supports an extra argument to specify the encoding, but I've looked through the entire table cant find ANSI anywhere.

Any suggestions would be great, thanks.

#### Nemesis09

##### Active member
I may have been a little hastey, when I use System.Text.Encoding.Default the text file remains in ANSI format.

Replies
1
Views
905
Replies
5
Views
4K
Replies
0
Views
2K
Replies
3
Views
435
Replies
4
Views
2K