G
Guest
Hi!
I don't know why, but I want to read a file, change some of the content, and
want to write this new content in another file. The problem is, that it
contains unicode text.
My code is:
System.IO.StreamReader reader =
new System.IO.StreamReader(this.openFileDialog1.FileName,Encoding.Unicode);
string new_filename = this.openFileDialog1.FileName.Replace(".txt",
"(###).txt");
System.IO.StreamWriter writer =
new System.IO.StreamWriter(new_filename, true, Encoding.Unicode);
string FILE = reader.ReadToEnd();
writer.Write(FILE);
writer.Close();
reader.Close();
I have not altered the content at all. This is the whole code from my
function private void openFileDialog1_FileOk(object sender, CancelEventArgs
e).
I hope you can help me. Please?
I don't know why, but I want to read a file, change some of the content, and
want to write this new content in another file. The problem is, that it
contains unicode text.
My code is:
System.IO.StreamReader reader =
new System.IO.StreamReader(this.openFileDialog1.FileName,Encoding.Unicode);
string new_filename = this.openFileDialog1.FileName.Replace(".txt",
"(###).txt");
System.IO.StreamWriter writer =
new System.IO.StreamWriter(new_filename, true, Encoding.Unicode);
string FILE = reader.ReadToEnd();
writer.Write(FILE);
writer.Close();
reader.Close();
I have not altered the content at all. This is the whole code from my
function private void openFileDialog1_FileOk(object sender, CancelEventArgs
e).
I hope you can help me. Please?