I am sorry if this Question is not well structured but this is a question that has been puzzling for a while now.
I know how to Read a Text file from the Open file Dialog into a Rich Text box using
DialogResult DR = openFileDialog1.ShowDialog();
if (DR == DialogResult.OK)
{
string txt = openFileDialog1.SafeFileName;
FileStream textFile = new FileStream(openFileDialog1.FileName, FileMode.Open, FileAccess.Read);
StreamReader doc = new StreamReader(textFile);
GetCurrentTextbox().Text = doc.ReadToEnd();
tabControl1.SelectedTab.Text = txt;
}
This works perfectly for Ordinary Text files but the Problem is that if this File was created using Wordpad or MsWord, it shows something like
Pls what can i do????