.net后台删除文件时若URL为相对路径

file = "~/images/1.jpg"
path=Server.MapPath(file);    //转为绝对路径
System.IO.File.Delete(path);

你可能感兴趣的:(.net后台删除文件时若URL为相对路径)