Answer: We have Exist static method of File class, which comes under System.IO namespace, so we can check whether folder is present in the drive or not.
Exist returns True/False values.
Using System.IO;
if(File.Exist("Path_of_folder"))
{
Response.Write("File Exists");
}
else
{
Response.Write("File does not Exist");
}
Asked In: Many Interviews |
Alert Moderator