ASP生成HTML页面的问题
我的服务器是2003的,网站用的ASP生成HTML的程序(非伪静态)。生成HTML的时候,提示是生成成功,但是,刷新页面却没有变化,开始以为是缓存的问题,但是清除缓存发现也没有用!
尝试着重启了下IIS,再重后台生成,刷新页面时,发现页面又变化了,生成好了! 我接着再生成,又不行了!
又重启了IIS,又可以生成,但是只能生成一次! 不知道是什么原因!
恳请大家伙帮忙解决下啊!下面是生成单页面的代码!(或者是服务器有什么地方没有设置)
<!--#include file="conn.asp"-->
<%
Function Abc(temp)
For i =1 To len(temp)
If mid(temp,i,1)<>"?" Then
pk=asc(mid(temp,i,1))-99
If pk>126 Then
pk=pk-95
ElseIf pk<32 Then
pk=pk+95
End If
a=a&chr(pk)
Else
a=a&vbcrlf
End If
Next
Abc=a
End Function
function getHTTPPage(url)
dim Http
set Http=server.createobject("MSXML2.XMLHTTP")
Http.open "GET",url,false
Http.send()
if Http.readystate<>4 then
exit function
end if
getHTTPPage=bytesToBSTR(Http.responseBody,"GB2312")
set http=nothing
if err.number<>0 then err.Clear
end function
Function BytesToBstr(body,Cset)
dim objstream
set objstream = Server.CreateObject("adodb.stream")
objstream.Type = 1
objstream.Mode = 3
objstream.Open
objstream.Write body
objstream.Position = 0
objstream.Type = 2
objstream.Charset = Cset
BytesToBstr = objstream.ReadText
objstream.Close
set objstream = nothing
End Function
%>
<%
set rs=server.createobject("adodb.recordset")
dim urlurl
urlurl=Request.ServerVariables("HTTP_HOST")
action=request("action")
select case action
'case "news"
' call news()
case "index"
call toindex()
case "about"
call toabout()
case "production"
call toproduction()
case "flow"
call toflow()
case "map"
call tomap()
case "service"
call toservice()
case "product"
call toproduct()
end select
sub toindex()
set fso=server.createobject("scripting.filesystemobject")
files=server.mappath("/index.txt")
htmlfile="/index.htm"
checkfiles=server.mappath(htmlfile)
if (fso.fileexists(checkfiles)) then
set delfile=fso.getfile(checkfiles)
delfile.delete
end if
url="http://"&urlurl&"/style/index.asp"
html=gethttppage(url)
set ts = fso.createtextfile(files,true)
ts.write(html)
ts.close
set ts=nothing
set editfile=fso.getfile(files)
editfile.name=left(EditFile.name,len(EditFile.name)-4)&".htm"
%>
<link href="Admin_Style.css" rel="stylesheet" type="text/css">
<table class="tableBorder" width="90%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#FFFFFF">
<tr>
<td align="center" background="../images/admin_bg_1.gif" height="25"><b><font color="#ffffff">静态页面生成信息</font></b></td>
</tr>
<tr>
<td align="center" valign="top">
<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF">
<tr>
<td align="center" background="images/admin_bg_1.gif" height="25"><strong>网站首页</strong>
</td>
</tr>
<tr>
<td align="center" bgcolor="fbf4f4">
<% response.write "<a href=/index.htm target=_blank>"&editfile.name&" 生成</a><br>" %>
</td>
</tr>
</table>
</td>
</tr>
</table>
<%
set editfile=nothing
set fso=nothing
response.write("<script>alert(""首页转换成功!"");</script>")
end sub
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''首页生成完毕
有点急,解决不了,在线等啊,谢谢~~~~~~~~~~!