首页 | 心情日记 | 建站心得 | 编程技术 | 大盘分析 | 股市信息 | 学习园地 | 电脑技巧 | 物流外贸 | 另类其它 | 站长推荐 | 给我留言 | 相册

用户登陆
用户:
密码:
 
不保存保存一天
保存一月保存一年

站点日历
73 2024 - 3 48
     12
3456789
10111213141516
17181920212223
24252627282930
31


站点统计

最新评论

日志搜索

 标题   内容


asp格式化日期时间格式的代码 防止数据库外链JS注入
未知 ASP创建word和excel文档   [ 日期:2010-07-08 00:05:45 ]   [ 来自:本站原创 ]

海外邮件中继,海外退信中继,美国高速VPS,不限流量VPN,邮局维护和管理,邮件网关,EMOS邮件中继,POSTFIX邮件中继,Winwebmail邮件中继,Winmail邮件中继,DBMail邮件中继,JDMail邮件中继,Exchange邮件中继,MDaemon邮件中继 淘宝店:http://shantan.taobao.com 云邮科技官网:www.yunrelay.com

【字体设置:
怎样通过ASP创建简易的OFFICE文档呢?快捷的生成word或excel文档进行办公应用处理!下面我们来详细讲解。
ASP具备动态输出任一Office应用程序文件格式的功能。在开始编写代码之前,我们首先需要做的就是设置正确的文件类型,因为浏览器需要知道如何处理文件。第二步是编辑文件名称,我们可以使用HTML和CSS来创建Word文档或Excel文档的样式。
下面这段例子代码可用于在线创建Word文档。

<%    
Response.ContentType = "application/msword"    
Response.AddHeader "Content-Disposition", "attachment;filename=NAME.doc"  
response.Write("Dotnetindex.com : <a href=""http://www.kkcode.com"">kkcode</a><br>" & vbnewline)   
response.Write("<h1>We can use HTML codes for word documents</h1>")    
response.Write ("<div style=""padding:4px; font:11px arial"">CSS can be used tooo</span>")    
%>    
<% 
Response.ContentType = "application/msword" 
Response.AddHeader "Content-Disposition", "attachment;filename=NAME.doc"
response.Write("Dotnetindex.com : <a href=""http://www.kkcode.com"">kkcode</a><br>" & vbnewline)
response.Write("<h1>We can use HTML codes for word documents</h1>") 
response.Write ("<div style=""padding:4px; font:11px arial"">CSS can be used tooo</span>") 
%> 

下面这段例子代码可用于在线创建Excel文档。 
<%    
Response.AddHeader "Content-Disposition", "attachment;filename=members.xls"    
Response.ContentType = "application/vnd.ms-excel"    
response.write "<table width=""100%"" border=""1"" >"    
response.write "<tr>"    
response.write "<th width=""40%""><b>Name</b></th>"    
response.write "<th width=""30%""><b>Username</b></th>"    
response.write "<th width=""30%""><b>Password</b></th>"    
response.write "</tr>"    
response.write "<tr>"    
response.write "<td width=""40%"">Scud Block</td>"    
response.write "<td width=""30%"">scud@gazatem.com</td>"    
response.write "<td width=""30%"">mypassword</td>"    
response.write "</tr>"    
response.write "</table>"    
%>

暂时没有评论
   发表评论 - 不要忘了输入验证码哦!
作者: 用户:  密码:  我要注册 验证码: 
为防止广告注册机程序,验证码不会自动显示,请点击此处显示或者(刷新)验证码!
评论:

禁止表情
禁止UBB
禁止图片
识别链接
识别关键字
确定发布?
最多可以输入200个字,目前你已经输入了0个字;你今日还可以发表10条评论!
 
   

CopyRight © 2008-2010 广东金融学院030904班 All Rights Reserved
Powered by www.030904.com