/// <summary> /// 删除文件系统中的文件 /// </summary> /// <param name="attachment">附件</param> protected void DeleteStoredFile(T attachment) { //如果属于图片附件,则还需删除生成的图片缩略图及附件原图 if (attachment.MediaType == MediaType.Image) { //删除所有图(包括原始图、缩略图) StoreProvider.DeleteFiles(attachment.GetRelativePath(), attachment.FileName); } else { StoreProvider.DeleteFile(attachment.GetRelativePath(), attachment.FileName); } }