📄 global.asa
字号:
<SCRIPT LANGUAGE=VBScript RUNAT="Server">
'You can add special event handlers in this file that will get run automatically when
'special Active Server Pages events occur. To create these handlers, just create a
'subroutine with a name from the list below that corresponds to the event you want to
'use. For example, to create an event handler for Session_OnStart, you would put the
'following code into this file (without the comments):
'Sub Session_OnStart
'**Put your code here **
'End Sub
'EventName Description
'Session_OnStart Runs the first time a user runs any page in your application
'Session_OnEnd Runs when a user's session times out or quits your application
'Application_OnStart Runs once when the first page of your application is run for the first time by any user
'Application_OnEnd Runs once when the web server shuts down
</SCRIPT>
<SCRIPT LANGUAGE=VBScript RUNAT="Server">
Sub Application_OnStart
application("user") = "sa"
application("pwd") = "gbs108@www"
application("dtbase")="dule"
'==Visual InterDev Generated - startspan==
'-- Project Data Environment
'Set DE = Server.CreateObject("DERuntime.DERuntime")
'Application("DE") = DE.Load(Server.MapPath("Global.ASA"), "_private/DataEnvironment/DataEnvironment.asa")
'==Visual InterDev Generated - endspan==
Set conn = server.CreateObject ("ADODB.Connection")
Set rs = server.CreateObject ("ADODB.Recordset")
conn.Open "dule","sa","gbs108@www"
sqlmain="select name from codes where secondtype=0"
rs.Open sqlmain,conn,1
application("MainCount")=rs.RecordCount
dim mainType(30),secondcount(20),secondType(30,20)
for i=1 to application("MainCount")
application("mainType("&i&")")=rs.Fields ("name")
'Response.Write application("mainType("&i&")")&"<BR>"
rs.MoveNext ()
next
rs.Close ()
conn.Close ()
Set conn = server.CreateObject ("ADODB.Connection")
Set rs = server.CreateObject ("ADODB.Recordset")
conn.Open "dule","sa","gbs108@www"
j=1
sqlsecond="select name from codes where maintype='"&j&"'"
rs.Open sqlsecond,conn,1
for j=1 to application("MainCount")
rs.close()
sqlsecond="select name from codes where maintype='"&j&"' and secondtype<> 0"
rs.Open sqlsecond,conn,1
application("SecondCount("&j&")")=rs.RecordCount
for m = 1 to application("secondCount("&j&")")
application("secondType("&j&","&m&")")=rs.Fields ("name")
'Response.Write application("secondType("&j&","&m&")")
rs.MoveNext ()
next
next
rs.Close ()
conn.Close ()
set conn=nothing
set rs=nothing
set out=nothing
set fileobject=nothing
End Sub
Sub Application_OnEnd
set FileObject=Server.CreateObject("Scripting.FileSystemObject")
set Out=FileObject.OpenTextFile(Application("VisitorsFileName"),2,false,false)
Application.Lock
Out.WriteLine(Application("Visitors"))
Application.UnLock
set out=nothing
set fileobject=nothing
End Sub
Sub Session_OnStart
session.Timeout = 60
'以下是小阮的代码
Session("firstliuyan") = True ' 判断是不是第一次进入留言本
Session("FirstInNewBook") = True
Session("logined") = False
Session("Total") = 0
End Sub
Sub Session_OnEnd
Session("logined") = False
End Sub
</SCRIPT>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -