ASP.NET如何删除服务器文件夹下的图片?
这是删除图片的代码
string path = Server.MapPath("~/images/Article");
foreach (string fileName in System.IO.Directory.GetFiles(path))
{
string newName = fileName.Substring(fileName.LastIndexOf("\") + 1);
System.IO.File.Delete(path + "\" + newName);//删除
}
