永发信息网

高手解释下这段ASP代码是咋个显示主页的?解析下~

答案:1  悬赏:0  手机版
解决时间 2021-05-17 01:00
  • 提问者网友:眉目添风霜
  • 2021-05-16 19:45
<!--#include file="conn.asp"-->
<!--#include file="inc/bloginfo.asp"-->
<!--#include file="inc/syscode.asp"-->
<!--#include file="inc/function.asp"-->
<%
dim show
if Application(cachename&"index_update")=false and application(cachename&"index")<>"" then
 show=application(cachename&"index")
else
 dim rstmp
 set rstmp=conn.execute("select skinmain from sysskin where isdefault='true'")
 show=rstmp(0)
 set rstmp=nothing
 call indexshow()
 Application.Lock
 application(cachename&"index")=show
 Application(cachename&"index_update")=false
 Application.unLock
 if Application(cachename&"siterefu")<>"" then
  conn.execute("update [bloginfo] set siterefu_num="&Application(cachename&"siterefu"))
 end if
end if
if instr(show,"$show_userlogin$")>0 then
 call showuserlogin()
 show=replace(show,"$show_userlogin$",show_userlogin)
end if
response.Write show
call bottom()
%>
最佳答案
  • 五星知识达人网友:底特律间谍
  • 2021-05-16 20:10
很显然用了缓存吗。。上来用if判断是否需要更新并且首页缓存是不是存在,如果存在,刚直接输出,如果不存在,就读取数据,不过下面这地方set rstmp=conn.execute("select skinmain from sysskin where isdefault='true'")应该是读取的模板信息,call indexshow()这一句是调用的一个函数,很显然就是显示首页内容的函数,然后再写入到缓存里面去
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯