سلام من میخوام یه سری اطلاعات از فایل txt بگیرم مشکل اینه که قسمتی که به فارسی درست نمایش داده نمی شه طوری Encoding کنم
 private void btn_ReadFile_Click(object sender, EventArgs e)
{
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
StreamReader objstream = new StreamReader(openFileDialog1.FileName,Encoding.Def ault );
string code = objstream.ReadLine();
txtMcode.Text = code.Substring(0, 2);
txtNcode .Text = code.Substring(2,3);
txtHcode.Text = code.Substring(5, 2);
txtPcode.Text = code.Substring(7, 3);

txtNname.Text = objstream.ReadLine();

}

}

سوال دوم برا ذخیره همین مورد با لا تو یه فایل txt باید چی بنویسم?
تا اینجاشا نوشتم

{ private void btnSaveFile_Click(object sender, EventArgs e)
{
if (saveFileDialog1 .ShowDialog() == DialogResult.OK)
{

File.WriteAllText(txtPname.Text + ".txt",txtHcode.Text,Encoding.Default );
}