For all the File manipulation function the namespace System.IO; has to be included.
The existence of a file can be checked by the following syntax , File.Exists(path);
where path is the path of the file name.
The code can be as.
if(File.Exists('C:\\dict.txt'))
{
Response.Write('File Exists');
}
else
{
Response.Write('File Not Found');
}
Share with