Question: how to check if file exist in asp.net c#?
Answer: string fileName = @ "c:\temp\Mahesh.txt"; if (File.Exists(fileName)) Console.WriteLine("File exists." ); else. Console. ...  After that check whether the file exists in a directory or not. if(File.Exists(@ "D:\myfile.txt")) { Console.WriteLine("The file exists."