您的位置:首页 > 编程语言 > ASP

asp.net 图片(文件类型)的保存和删除处理模型

2010-02-03 11:40 351 查看
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);
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: