随笔 - 34  文章 - 8 评论 - 35 trackbacks - 1
<2008年5月>
27282930123
45678910
11121314151617
18192021222324
25262728293031
1234567

与我联系

搜索

 

常用链接

留言簿

随笔档案(37)

相册

收藏夹(4)

链接

最新随笔

积分与排名

  • 积分 - 11729
  • 排名 - 2931

阅读排行榜

  protected void lnkDownLoad_Click(object sender, EventArgs e)
    {

        KeFu.BLL.tbl_Dealer_Kefu kefuBll = new KeFu.BLL.tbl_Dealer_Kefu();
        DataSet data = kefuBll.GetList("  iId =7");
        //下载work文档

        if (data.Tables[0].Rows[0]["OtherContent"].ToString().Length > 0)
        {

            DataRow dr = (DataRow)data.Tables[0].Rows[0];
            Response.Buffer = true;
            Response.Clear();
            Response.ContentType = dr["OtherContent"].ToString();
            Response.AddHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(dr["OtherContent"].ToString()));
            Response.WriteFile("File\\" + dr["OtherContent"].ToString());//取得相对路径
            Response.Flush();
            Response.End();
        }
        else
        {
            MessegeBox.Show(this, "无上传文档");
        }
    }

posted on 2008-05-19 14:38 星答 阅读(34) 评论(0)  编辑 收藏

标题  
姓名  
主页
Email (只有博主才能看到) 
验证码 *  看不清,换一张 [登录][注册]
内容(请不要发表任何与政治相关的内容)  
  登录  使用高级评论  新用户注册  返回页首  恢复上次提交      
该文被作者在 2008-05-27 17:27 编辑过


相关链接: