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);
如果不是用你那种小工具批量处理的话 就不需要记录路径了!
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);
相关文章推荐
- ASP.NET:在一般处理程序中通过 Session 保存验证码却无法显示图片?
- asp.net 管道模型+生命处理周期
- ASP.NET上传图片以二进制保存到数据库
- asp.net 删除编辑器上传的图片
- 在ASP.NET中把图片保存到SQL SERVER数据库
- ASP.net的HTTP处理程序(ASHX)提取dll内嵌资源图片
- 用ASP.NET实现下载远程图片保存到本地的方法 保存抓取远程图片的方法
- asp.net ,c# 保存图片入数据库
- 使用Jcrop实现图片上传、剪裁和保存(ASP.NET)
- Asp.net 上传图片,保存路径到数据库
- ASP.NET 不经保存,直接生成上传图片的等比例的高质量缩略图
- ASP.NET Core如何添加统一模型验证处理机制详解
- [翻译]ASP.NET探秘——IIS和处理模型
- ASP.NET图片处理问题总结
- ASP.NET下载远程图片保存到本地的方法、保存抓取远程图片
- 在ASP.NET Web Application 中如何处理图片 【转】-有用
- 关于asp.net网站上传图片功能失败的处理
- asp.net 动态压缩、切割图片,并做缓存处理机制
- asp.net保存网上图片到服务器的实例
- 在ASP.NET中把图片保存到SQL SERVER数据库