1:建议存图片和文件的时候 只存名字就行了(路径是一样的 存起来占地方)
如果不是用你那种小工具批量处理的话 就不需要记录路径了!
2:删除服务器上指定文件,模型。
System.IO.File.Delete(Server.MapPath("../" + "corporation/" + strTempPath);
3:获取当前页面的物理路径:
//string sPath = HttpContext.Current.Request.Url.PathAndQuery.ToString();
4:获取路径
//string sPath = System.Web.HttpContext.Current.Request.MapPath("../" + "corporation/" + strTempPath);//~/上一级 ..//
//string ss = HttpContext.Current.Server.MapPath("bak");
// string sPath = System.IO.Path.GetDirectoryName(Page.Request.PhysicalPath);