Good day,
I started to program c# some days ago and I´m having difficulty to read a text file.
I wrote the code below to read the following line of a text file:
AdmPassword=�‘“•—™
All caracters of the password have decimal values between 128 and 255.
The problem is . . . when I run the program, it give to me the following string:
AdmPassword=������
Someone know what I have to do to program read the file correctly?
Thankyou.
private void abrirToolStripMenuItem_Click(object sender, EventArgs e)
{
string strAuxiliar = " ";
/* Abre o Arquivo */
if(openFileDialog1.ShowDialog() == DialogResult.OK)
{
System.IO.StreamReader LeitorDoArquivo = new
System.IO.StreamReader(openFileDialog1.FileName);
/* Lê a Linha do Arquivo */
strAuxiliar = LeitorDoArquivo.ReadLine();
}
}