Hi SUJAYS,
Use DirectoryInfo class.
Please refer below code.
Code
public void CheckFileExist()
{
string folderPath = Server.MapPath("~/Files");
DirectoryInfo directoryInfo = new DirectoryInfo(folderPath);
FileInfo[] excels = directoryInfo.GetFiles("*.xlsx");
string isExists= excels.Length > 0 ? "File exists." : "File does not exist.";
}
Output
File exists.