In C# how do I read and display code from an HTML file to a textbox using the...

  • Thread starter Thread starter pandemonium1x
  • Start date Start date
P

pandemonium1x

Guest
...StreamReader? Here's my code which obviously does not work but it will give an idea of where I am at.


openFileDialog1.Filter = "HTML File (*.html)|*.html|All files (*.*)|*.*";
openFileDialog1.FileName = "";


if (openFileDialog1.ShowDialog() != DialogResult.Cancel)
{
//Put filename in textbox
txtPath.Text = openFileDialog1.FileName;

//Load the Reader
StreamReader reader = new StreamReader (openFileDialog1.FileName);

reader.Read();

txtDisplay.Text = reader.Read().ToString();
reader.Close();
}
 
Back
Top