当前位置: 代码迷 >> ASP.NET >> 急救 关于页面上载
  详细解决方案

急救 关于页面上载

热度:9379   发布时间:2013-02-25 00:00:00.0
急救 关于页面下载
我能获取一个文件路径 
怎么下载这个文件
代码怎么写
#
protected void Page_Load(object sender, EventArgs e)
  {
  if (Request.QueryString["Id"] != null)
  {
  try
  {
  int id = int.Parse(Request.QueryString["id"].ToString());
  Files file = bll.GetModel(id);

  Response.Clear();
  Response.Charset = "GBK";
  Response.ContentEncoding = System.Text.Encoding.UTF8;
  Response.(Common.ConfigHelper.GetConfigString("UpFiles") + "/" +file.FilePath.ToString());
  Response.End();
  }
  catch (Exception ex)
  {
  string err = ex.Message;
  }
  }
  }

------解决方案--------------------------------------------------------
Request.Files[0].SaveAs(Server.MapPath(路径));
  相关解决方案