通过值和网站网站属性(hc)删除上传文件 - DeleteUploadFile
2017-03-05 09:46:19 访问(1693) 赞(0) 踩(0)
/// <summary>
/// 通过值和网站网站属性(hc)删除上传文件 - DeleteUploadFile +
/// </summary>
/// <param name="hc"></param>
/// <param name="str"></param>
public void DeleteUploadFile(HttpContext hc, string str)
{
if (hc == null)
return;
if (str == null || str.Length == 0)
return;
if (!str.StartsWith("-/"))
return;
string phyPath = hc.Request.PhysicalApplicationPath;
string fullName = phyPath + str.Substring(2);
if (!File.Exists(fullName))
return;
File.Delete(fullName);
}
标签:
通过值和网站网站属性(hc)删除上传文件 - DeleteUploadFile 


上一条:
下一条:
相关评论
发表评论