1
Answer

file not found exception

try
{
string fileName= @"C:\Users\tnhfcl\Desktop\satya.txt ";
StreamReader streamreader = new StreamReader(fileName);
Console.WriteLine( streamreader.ReadToEnd());
Console.ReadLine();
streamreader.Close();
}
catch (FileNotFoundException ex)
{
Console.WriteLine(ex.FileName);
Console.ReadLine();
}
Answers (1)