www.gusucode.com > 易心博客[圣诞版] 3.5手动安装码程序 > AutoHtml.asp
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%> <!--#include file="Conn.asp"--> <!--#include file="Ex_Cls/Ex_SkinCls.asp"--> <!--#include file="Ex_Cls/Ex_RefreshCls.asp"--> <% Dim Action,ExComm,ExRefresh,ExFso Set ExComm=new Ex_CommonCls Set ExRefresh=new Ex_Refreshcls Set ExFso=new Ex_FsoCls Function CreateWaitHtml Dim Temp,Rs Temp=ExFso.ReadFile("Cache\WaitHtml.Txt") If Temp="文件不存在" Or Trim(Temp)="" Then Temp="html|||class|||view|||" Set Rs=server.CreateObject("adodb.recordset") Rs.open "select tagname from Ex_Tags",Conn,1,1 If Not Rs.eof And Not Rs.bof Then Do While Not Rs.eof Temp=Temp&","&Rs("TagName") Rs.movenext Loop End If ExFso.CreateFile "Cache\WaitHtml.txt",Temp End If CreateWaitHtml=Temp End Function Sub Html Dim ProMsg If ExComm.IsCache("Page")=False Or Application(Sn&"HtmlType")<>"html" Then Application.Lock Application(sn&"page")=1 Application(Sn&"HtmlType")="html" Application.UnLock End If ExRefresh.CreateList "","","","","",Application(sn&"Page") If CInt(Application(sn&"Page")-1)>=CInt(Application(Sn&"PageTotal")) Then ExComm.ClearCache(Sn&"Page") ExComm.ClearCache(Sn&"HtmlType") ExComm.ClearCache(Sn&"PageTotal") ExFso.CreateFile "Cache\WaitHtml.Txt",Replace(CreateWaitHtml,"html|||","") End If End Sub Sub Cls Dim ProMsg,HtmlCls If ExComm.IsCache("Page")=False Or Application(Sn&"HtmlType")<>"cls" Or ExComm.IsCache("HtmlCls")=False Then ExComm.GetClassCache Application.Lock Application(sn&"page")=1 Application(Sn&"HtmlType")="cls" Application(sn&"HtmlCls")=Application(Sn&"Class") Application.UnLock End If If ExComm.IsCache("HtmlClsId")=False Then HtmlCls=Split(Application(sn&"HtmlCls"),"а")(1) Application.Lock Application(Sn&"HtmlClsId")=Split(HtmlCls,"б")(0) Application.Unlock End If ExRefresh.CreateList "","",Application(Sn&"HtmlClsId"),"","",Application(sn&"Page") If CInt(Application(Sn&"Page"))>=CInt(Application(Sn&"PageTotal")) Then ExComm.ClearCache(Sn&"HtmlClsId") Application.Lock Application(sn&"page")=1 HtmlCls=Split(Application(sn&"HtmlCls"),"а")(1) Application(sn&"HtmlCls")=Replace(Application(sn&"HtmlCls"),"а"&HtmlCls,"") Application.Unlock End If If ExComm.IsCache("HtmlCls")=False Then ExComm.ClearCache(Sn&"HtmlType") ExFso.CreateFile "Cache\WaitHtml.Txt",Replace(CreateWaitHtml,"class|||","") End If End Sub Sub view Dim ProMsg,Id,Rs If ExComm.IsCache("Page")=False Or Application(Sn&"HtmlType")<>"view" Then Application.Lock Application(sn&"page")=1 Application(Sn&"HtmlType")="view" Application.UnLock End If ExRefresh.CreateView "" If CInt(Application(sn&"Page")-1)>=CInt(Application(Sn&"PageTotal")) Then ExComm.ClearCache(Sn&"Page") ExComm.ClearCache(Sn&"HtmlType") ExComm.ClearCache(Sn&"PageTotal") ExFso.CreateFile "Cache\WaitHtml.Txt",Replace(CreateWaitHtml,"view|||","") End If End Sub Sub Tags Dim ProMsg,HtmlTags,Rs,ExFso Set ExFso=new Ex_FsoCls If ExComm.IsCache("Page")=False Or Application(Sn&"HtmlType")<>"tags" Or ExComm.IsCache("Total")=False Then Set Rs=server.CreateObject("adodb.recordset") Rs.open "select tagname from Ex_Tags",Conn,1,1 If Not Rs.eof And Not Rs.bof Then Do While Not Rs.eof HtmlTags=HtmlTags&","&Rs("TagName") Rs.movenext Loop End If Application.Lock Application(Sn&"Total")=Rs.RecordCount Application(Sn&"CurNum")=1 Application(sn&"page")=1 Application(Sn&"HtmlType")="tags" Application.UnLock ExFso.CreateFile "Cache\WaitHtml.txt",HtmlTags End If If HtmlTags="" Then HtmlTags=ExFso.ReadFile("Cache\WaitHtml.txt") End If If ExComm.IsCache("HtmlTag")=False Then Application.Lock Application(Sn&"HtmlTag")=Split(HtmlTags,",")(1) Application.Unlock End If ExRefresh.CreateList "tags",Application(Sn&"HtmlTag"),"","","",Application(sn&"Page") If CInt(Application(Sn&"Page"))>=CInt(Application(Sn&"PageTotal")) Then Application.Lock Application(sn&"page")=1 Application(Sn&"CurNum")=Application(Sn&"CurNum")+1 Application.Unlock HtmlTags=Replace(HtmlTags,","&Application(Sn&"HtmlTag"),"") ExFso.CreateFile "Cache\WaitHtml.txt",HtmlTags ExComm.ClearCache(Sn&"HtmlTag") End If If InStr(HtmlTags,",")=0 Then ExComm.ClearCache(Sn&"HtmlType") End If End Sub If ExComm.IsCache("IsAutoHtml")=False Then ExComm.GetConfig("IsAutoHtml") End If If Application(sn&"isautohtml")="是" Then Dim WaitHtml WaitHtml=CreateWaitHtml ExComm.GetConfigCache("*") If InStr(WaitHtml,"html|||")<>0 Then html ElseIf InStr(WaitHtml,"class|||")<>0 Then cls ElseIf InStr(WaitHtml,"view|||")<>0 Then view Else tags End If End If %>