| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 408 人关注过本帖
标题:ASP生成HTML页面的问题
只看楼主 加入收藏
only_cl
Rank: 1
等 级:新手上路
帖 子:12
专家分:0
注 册:2007-5-17
结帖率:0
收藏
已结贴  问题点数:20 回复次数:2 
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">&nbsp;
  
<%   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
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''首页生成完毕
有点急,解决不了,在线等啊,谢谢~~~~~~~~~~!
搜索更多相关主题的帖子: ASP HTML 页面 
2009-09-08 01:24
孤独冷雨
Rank: 10Rank: 10Rank: 10
来 自:安徽滁州
等 级:贵宾
威 望:23
帖 子:1247
专家分:1909
注 册:2007-6-4
收藏
得分:10 

这里有男女系列成人用品,有时间兄弟们来看一看.
51za.
2009-09-08 09:00
gdk2006
Rank: 4
等 级:业余侠客
威 望:8
帖 子:928
专家分:270
注 册:2006-7-2
收藏
得分:10 
建议用读取模板的方式去生成静态的页面。

程序员的悲哀如何找女朋友?
追女解决方案百度“让她着迷”!
2009-09-08 13:22
快速回复:ASP生成HTML页面的问题
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.015833 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved