易截截图软件、单文件、免安装、纯绿色、仅160KB

ASP.NET下载——word,txt,图片方法

ASP.NET下载——word,txt,图片方法
  本文主要介绍ASP.NET下载诸如word,txt,图片等的方法。
 
   try
  {
  FullFileName = Server.MapPath(FileName); //FileName--要下载的文件名
  FileInfo DownloadFile= new FileInfo(FullFileName);
  if(DownloadFile.Exists)
  {
  Response.Clear();
  Response.ClearHeaders();
  Response.Buffer=false;
  Response.ContentType="application/octet-stream";
  Response.AppendHeader("Content-Disposition","attachment;filename="
  +HttpUtility.UrlEncode(DownloadFile.FullName,System.Text.Encoding.ASCII));
  Response.AppendHeader("Content-Length",DownloadFile.Length.ToString());
  Response.WriteFile(DownloadFile.FullName);
  Response.Flush();
  Response.End();
  }
  else{
  //文件不存在
  }
  }
  catch{
  //文件不存在


相关文档:

asp.net (c#)控件大全

DataGridView 控件DataGridView 控件提供用来显示数据的可自定义表。使用 DataGridView 类,可以自定义单元格、行、列和边框。
注意
DataGridView 控件提供 DataGrid 控件所不具备的许多基本和高级功能。有关更多信息,请参见 Windows 窗体 DataGridView 控件和
DataGrid 控件之间的区别
常用属性:
DefaultCellStyle、 ......

Asp.Net 构架(HttpModule 介绍)

http://www.cnblogs.com/JimmyZhang/archive/2007/11/25/971878.html
引言
Http 请求处理流程 和 Http Handler 介绍 这两篇文章里,我们首先了解了Http请求在服务器端的处理流程,随后我们知道Http请求最终会由实现了IHttpHandler接口的类进行处理(应该记得Page类实现了IHttpHandler)。从 Http 请求处理流程 一文的最后的 ......

Asp.NET获取文件及其路径


【相对路径】
Request.ApplicationPath
/src
Path.GetDirectoryName(HttpContext.Current.Request.RawUrl )
\\src\\Xiaoshe
Context.Request.Path
/src/Xiaoshe/Xiaoshe_New.aspx
Context.Request.CurrentExecutionFilePath
/src/Xiaoshe/Xiaoshe_New.aspx
Context.Request.FilePath
/src/Xiaoshe/Xiaoshe ......

在 IIS 6.0 中部署ASP.NET MVC程序

在 IIS 6.0 中部署ASP.NET MVC程序


1、安装ASP.NET MVC框架程序
   AspNetMVC1.msi 下载地址:
   http://www.microsoft.com/downloads/details.aspx?FamilyID=53289097-73ce-43bf-b6a6-35e00103cb4b&displaylang=en
2、设置IIS
 1) ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号