网站中的简历下载用.net怎么做? 求各位大神帮忙,在做一个招聘网站,个人用户注册后,可以填写简历,企业在查看到简历后,有个下载功能,但是不知道怎么实现将数据库中的简历信息字段转换成可以下载到本地的word形式,请各位帮帮忙,在此感激不尽。本人分不多,先谢谢各们了。招聘网站中的简历下载用.net怎么做? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 /// <summary> /// 导出到文件的方法, /// </summary> /// <param name="Model">Model=1:导出为Execl,Model=2:导出为Word</param> private void toFiles(int Model) { string strFileName = DateTime.Now.ToString("yyyyMMdd-hhmmss"); System.Web.HttpContext HC = System.Web.HttpContext.Current; HC.Response.Clear(); HC.Response.Buffer = true; HC.Response.ContentEncoding = System.Text.Encoding.UTF8;//设置输出流为简体中文 if (Model == 1) { //---导出为Excel文件 HC.Response.AddHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(strFileName, System.Text.Encoding.UTF8) + ".xls"); HC.Response.ContentType = "application/ms-excel";//设置输出文件类型为excel文件。 } else { //--- 导出为Word文件 HC.Response.AddHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(strFileName, System.Text.Encoding.UTF8) + ".doc"); HC.Response.ContentType = "application/ms-word";//设置输出文件类型为Word文件。 } System.IO.StringWriter sw = new System.IO.StringWriter(); System.Web.UI.HtmlTextWriter htw = new System.Web.UI.HtmlTextWriter(sw); this.GridView1.RenderControl(htw); HC.Response.Write(sw.ToString()); HC.Response.End(); } 在C#中,是否应当常常使用ref作为传参? 小白求助关于C#修改表中有计算列 点gridview里的button不会执行gridview_rowcommand事件,但也不报错,是什么原因??? 请问在外测的时候如何保留出错时的数据? 如何远程测试web service C#源码100例及仿QQ2008聊天程序(c#源代码) 【请教】怎样截取字符串后半部分的数字串? 求救,对XML的节点的查找怎么找啊。。?? 查询总和SQL 怎么读取txt文件的最后一行啊? C#中哪个控件的列宽度可以按比例来设置 word document.open()
/// <summary> /// 导出到文件的方法, /// </summary> /// <param name="Model">Model=1:导出为Execl,Model=2:导出为Word</param> private void toFiles(int Model) { string strFileName = DateTime.Now.ToString("yyyyMMdd-hhmmss"); System.Web.HttpContext HC = System.Web.HttpContext.Current; HC.Response.Clear(); HC.Response.Buffer = true; HC.Response.ContentEncoding = System.Text.Encoding.UTF8;//设置输出流为简体中文 if (Model == 1) { //---导出为Excel文件 HC.Response.AddHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(strFileName, System.Text.Encoding.UTF8) + ".xls"); HC.Response.ContentType = "application/ms-excel";//设置输出文件类型为excel文件。 } else { //--- 导出为Word文件 HC.Response.AddHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(strFileName, System.Text.Encoding.UTF8) + ".doc"); HC.Response.ContentType = "application/ms-word";//设置输出文件类型为Word文件。 } System.IO.StringWriter sw = new System.IO.StringWriter(); System.Web.UI.HtmlTextWriter htw = new System.Web.UI.HtmlTextWriter(sw); this.GridView1.RenderControl(htw); HC.Response.Write(sw.ToString()); HC.Response.End(); }