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

推荐订阅源

Hugging Face - Blog
Hugging Face - Blog
Vercel News
Vercel News
C
Check Point Blog
G
Google Developers Blog
博客园 - 司徒正美
量子位
Engineering at Meta
Engineering at Meta
S
SegmentFault 最新的问题
Google DeepMind News
Google DeepMind News
F
Fortinet All Blogs
A
About on SuperTechFans
美团技术团队
D
DataBreaches.Net
Stack Overflow Blog
Stack Overflow Blog
Jina AI
Jina AI
Y
Y Combinator Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Apple Machine Learning Research
Apple Machine Learning Research
J
Java Code Geeks
MongoDB | Blog
MongoDB | Blog
人人都是产品经理
人人都是产品经理
H
Hackread – Cybersecurity News, Data Breaches, AI and More
The Cloudflare Blog
U
Unit 42

博客园 - №阿儒№

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();