Kitty,
You might try something like:
private void button1_Click(object sender, EventArgs e)
{
openFileDialog1.Filter = "Text Files|*.txt";
openFileDialog1.ShowDialog(this);
Stream sr = openFileDialog1.OpenFile();
byte[] buff = new byte[70];
sr.Read(buff, 0, 60);
System.Diagnostics.Debug.WriteLine(Encoding.ASCII. GetString(buff));
sr.Close();
}
This does not take into account end of line or end of stream and just writes the output to the debuggin window.
Good Luck.
What you don't know can hurt you!
|