asp 中数据导出为 word ,excl ,text ,等格式文件
这是从方法直接复制的,
参数 fileType是文件格式
参数filedName是写出后文件的文件名。
参数suffix是写出后文件的文件后缀名。
Response.Clear(); //清空 缓冲区的所有输出数据
Response.Charset = "utf-8";//设置输出输出流字符类型
Response.ContentType = fileType;设置输出流的 file MIME类型
Response.AppendHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(fileName) + suffix);//将HTTP 头添加到输出流,“+”以前是固定的 字符串连接是为了写文件名和文件后缀名
Response.Write("<html><head><Meta http-equiv=\"Content-Type\"content=\"text/html;charset=utf-8\"></head><body>");
Response.Write("<h1>"+article.Title+"</h1><p/>"+article.Context);
Response.Write("</body></html>");
//文件内容
Response.End();
//关闭
当导出的文件为 文本格式时 Response.Write(" ")中就不必写入HTML代码,如果写入了,文本内容会出现 HTML
Response.ContentType ="application/ms-excel";是excel
Response.ContentType ="Content-Disposition";是word
相关文档:
只需要在fckeditor\editor\filemanager\connectors\asp文件夹下的commands.asp修改一下即可
在这个文件中查找一下:FileUpload
会找到这个函数
把
代码如下:
Dim sFilePath
sFilePath = CombineLocalPaths(sServerDir, sFileName)
改为
代码如下:
Dim sFilePath,ranNum
Randomize
ranNum=int(90000*rnd)+ ......
<bgsound src="wen.mid" loop="0">
<% dim weh
If Time >=#1:00:00 AM# And Time < #6:00:00 PM# Then
weh = "<bgsound src="1.mid" loop="0">"
Else If Time >#6:00:00 AM# And Time < #9:00:00 PM#
weh = "<bg ......
第一节:注册系统
注册几乎是每个网站都要使用的,去论坛要注册,聊天要注册,几乎无处不注册,所以注册是所有ASP应用程序中最常见的。
& ......
利用ASP打造网站论坛DIY(3)
2、构建文章显示模块
前面说过,一片具体的文章是分属在看板和主体之下的。因此显示文章也要经过看板列表和主体列表这两页面后,才能得到特定主题下文章的列表。
(1)板列表的显示页面:
< html>
< head>
< title>看板列表< /title>
< meta htt ......
目前在Internet上广泛使用的后台技术种类繁多,应用比较广泛的有CGI,ASP,PHP,JSP/JavaServlet,ColdFusion等。在这一节里,主要介绍几种在国内应用比较广泛的后台语言。
CGI,全称为Common Gateway Interface
CGI就是公共网关接口 (Common Gateway Interface) 的缩写。它是最早被用来建立动态网站的后台技术 ......