string FileName =test.doc";
string FilePath = "c:\\" + FileName;
FileInfo TheFile = new FileInfo(FilePath);
if (TheFile.Exists)
{
TheFile.Delete();
//File.Delete(FilePath);
}
else
{
throw new FileNotFoundException();
}
No comments:
Post a Comment