how can I get a string(chinese character) from a text file?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

how can I get a string(chinese character) from a text file
thank you!
 
Hi flybrid,

StreamReader sr = new StreamReader(filepath, System.Text.UnicodeEncoding);
string text = sr.ReadToEnd();
sr.Close();

This should get you a string of whatever is inside the file. This sample specifies Unicode as the text format of the file.

Happy coding!
Morten Wennevik [C# MVP]
 
flybrid said:
how can I get a string(chinese character) from a text file?

Please see my response to your question from yesterday.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top