3.页面过期和缓冲设定
<%
'过期和缓冲处理
response.buffer=true
response.cachecontrol="no-chache"
response.expiresabsolute=now()-1
response.expires=0
%>
html中还可以做设定:
<meta content="no-cache" http-equiv="Pragma">
<meta HTTP-EQUIV="Expires" CONTENT="0">
4.移植性的保证
⑴.包含文件
<!--#include file="top.asp" -->
⑵.使用server.mappath寻找文件路径,避免在页面中直接使用绝对路径
⑶.尽量使用组件封装业务逻辑
5.调试内部服务器500的错误
⑴.设置IIS显示具体的错误信息
⑵.分步调试,由上而下
⑶.打印某些重要的变量的值,检查是否为我们预期
⑷.根据经验来判断错误
7. 操作Word文档
⑴.安装Office 2000,其中Word 2000必选
⑵.设置IE中Internet的安全性:ActiveX控件和插件全部启用
⑶.设置工作目录的文件权为Internet及System读取/修改/写入
⑷.编写模版course.dot
⑸.具体代码:
opr_doc_inc.asp
<%
Response.write "Dim Var_Num" & chr(13)
Response.write " Var_Num = 2 " & chr(13)
Response.write "Dim varstrings(2)" & chr(13)
Response.write "varstrings(0)=" & chr(34) & "起草人:" & chr(34) & chr(13)
Response.write "varstrings(1)=" & chr(34) & "日期:" & chr(34) & chr(13)
Response.write "Dim varValues(2)" & chr(13)
Response.write "varValues(0)=" & chr(34) &"起草人:涂海涛"& chr(34) & chr(13)
Response.write "varValues(1)=" & chr(34) & "日期:"&date()& chr(34) & chr(13)
%>
Sub instead(word)
Set myRange = word.ActiveDocument.Content
for i=0 to Var_Num - 1
call myRange.Find.Execute(varStrings(i),false,false,false,false,false,false,false,false,varValues(i),2)
Next
End Sub
opr_doc.asp
<%
'获取保存的路径
path=server.mappath("opr_doc.asp")
path=left(path,len(path)-11)
filenames=path&"test.doc"
w1="word.ac
| 对此文章发表了评论 |
