System.IO.FileInfo file = new System.IO.FileInfo(Application.StartupPath + "\\1.jpg");
if (file.Exists)
{
file.Delete();
}
public static bool FilePicDelete(string path)
{
bool ret = false;
System.IO.FileInfo file = new System.IO.FileInfo(path);
if (file.Exists)//文件是否存在,存在则执行删除
{
file.Delete();
ret = true;
}
return ret;
}
黑色头发:http://heisetoufa.iteye.com