OpenFileDialog odlg = new OpenFileDialog();
odlg.Title = "Select a text file";
odlg.Filter = "Text File|*.txt|All File|*.*";
if (odlg.ShowDialog() != DialogResult.Cancel)
{
Application.DoEvents();
txt_TextFile.Text = odlg.FileName;
string s = System.IO.File.ReadAllText(odlg.FileName);
txt_TextContainer.Text = s;
}
No comments:
Post a Comment