日期:2014-05-17 浏览次数:20647 次
string FileName = “sssssss.doc”;
HttpContext.Current.Response.Charset = "GB2312";
HttpContext.Current.Response.ContentEncoding = Encoding.UTF8;
HttpContext.Current.Response.ContentType = "application/ms-winword";
HttpContext.Current.Response.AppendHeader("Content-disposition", "attachment;filename=" + HttpUtility.UrlEncode(FileName, Encoding.UTF8).ToString());
//HttpContext.Current.Response.
//Lb_Const[0][10].Page.EnableViewState = false;
StringWriter sw = new StringWriter();
HtmlTextWriter tw = new HtmlTextWriter(sw);
//Label lb = null;
//lb = (Label)this.Page.FindControl("Label1");
//if (lb != null) { lb.RenderControl(tw); }
this.Label1.RenderControl(tw);
string css_txt = "<style>" + Css_read() + "</style>";
HttpContext.Current.Response.Write(sw.ToString());
HttpContext.Current.Response.End();