I'm working with a notepad in C#, and when you write in the textbox the lettters appear (å, ä, ö). But if you open a .txt-file my program can't read å, ä, ö.
DialogResult resultOpenFile = OpenFile.ShowDialog();
if (resultOpenFile == DialogResult.OK)
{
StreamReader of = new StreamReader(OpenFile.FileName); // Startar inläsning utav ful.
textBox.Text = of.ReadToEnd();
of.Close(); // Avslutar inläsningen.
sfd.FileName = OpenFile.FileName; // Föreslår samma filnamn som den öppnade filen.
string fil = Convert.ToString(Path.GetFileName(OpenFile.FileName)); // Gör om filnamnet till en string.
Text = fil + " - Textredigeraren " + Textredigeraren.info.version; // Gör så att filnamnet står med i titeln.
}
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.