Thank you helped solve the problem Jibesh
public Form1()
{
InitializeComponent();
}
public Form1(string filename)
{
InitializeComponent();
if (filename != null)
{
try
{
StreamReader reader = new StreamReader(filename);
char[] data = new char[filename.Length];
reader.ReadBlock(data, 0, (int)filename.Length);
textBox1.Text = new string(data);
reader.Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}