惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

人人都是产品经理
人人都是产品经理
Blog — PlanetScale
Blog — PlanetScale
MyScale Blog
MyScale Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
WordPress大学
WordPress大学
Vercel News
Vercel News
D
Docker
博客园 - 聂微东
T
Tailwind CSS Blog
aimingoo的专栏
aimingoo的专栏
云风的 BLOG
云风的 BLOG
D
DataBreaches.Net
B
Blog RSS Feed
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - Franky
Microsoft Security Blog
Microsoft Security Blog
美团技术团队
F
Fortinet All Blogs
MongoDB | Blog
MongoDB | Blog
T
The Blog of Author Tim Ferriss
GbyAI
GbyAI
N
Netflix TechBlog - Medium
G
Google Developers Blog
腾讯CDC

博客园 - №阿儒№

Inetinfo 进程 100%的解决方法 useless setTimeout call (missing quotes around argument?)解决方案 "invalid header field"解决方案 解决因为安装Lingoes 2.4后剪贴板无法正常工作的问题 FreeMarker学习 Extjs分页时遇上ivalid label的解决原理 UTF8与UTF8 without BOM之间的问题 - №阿儒№ [错误解决列表]解决异常信息 收集中 解决WEB页的中英文显示问题 [bug]Upload Excel File时碰到的问题 [bug]解决因系统问题无法连接MQ reporting service学习-- 配置文件 [bug]访问ASP.NET临时文件夹的权限问题 如何解决FTP上传文件时出现的"Access is denied"错误? - №阿儒№ SQL Server 2005 Reporting Services 初次使用感受 [bug]Server Application Unavailable VS 中最简单的部署方式XCOPY Link Server的语法 [Bug]:创建虚拟目录出现别名已经存在的解决方案
将HTML中的内容存入WORD
№阿儒№ · 2005-09-01 · via 博客园 - №阿儒№

                DateTime dtime = DateTime.Now;
                
string FileName = dtime.Year.ToString() + "-" + dtime.Month.ToString() + "-" + dtime.Day.ToString() 
                    
+ "~" + dtime.Hour.ToString() + "-" + dtime.Minute.ToString() + "-" + dtime.Second.ToString() + "-" + dtime.Millisecond.ToString() + ".doc";
                
string Path = Server.MapPath("../PhoneSN_doc/" + FileName);

                StreamWriter sr 
= File.CreateText(Path);
                StringWriter tw 
= new StringWriter();
                HtmlTextWriter hw
=new HtmlTextWriter(tw);
                
//tb0.RenderControl(hw);
                tb1.RenderControl(hw);
                tb2.RenderControl(hw);
                tb3.RenderControl(hw);
                tb4.RenderControl(hw);
                tb8.RenderControl(hw);
                tb5.RenderControl(hw);
                tb6.RenderControl(hw);
                tb7.RenderControl(hw);
                sr.Write(tw.ToString());
                tw.Close();
                sr.Close();

                System.IO.FileInfo file 
= new System.IO.FileInfo(Path);
                Response.Clear();

                Response.AddHeader(
"Content-Disposition""attachment; filename=" + file.Name);


                Response.AddHeader(
"Content-Length", file.Length.ToString());

                Response.ContentType 
= "application/octet-stream";

                Response.WriteFile(file.FullName);

                Response.End();