|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
写软件都是想的时间比写的时间要长的.如果反过来了就得看看是什么原因了.另外大家可以回去问问公司里的小MM.(一般企业里,跟你们交付软件接触得最多的是她们)把持|显现|在线
上面是global.asa的内容:
SubApplication_OnStart
Deleteallsavedsessioninformation,incaseofacrash
setobjADO=Server.CreateObject("ADODB.Connection")
sDatabasePath=Server.MapPath("/databases")
sConnection
="filedsn="&sDatabasePath&"eadwrite.dsn;DBQ="&sDatabasePath&"sessi
ons.mdb;"
objADO.Open(sConnection)
sUpdateCmd="delete*fromsession;"
objADO.Execute(sUpdateCmd)
Closethedatabasedownagain
objADO.close
setobjADO=Nothing
NowstoretheDSNconnectionstringaway,sowedonthavetolook
itupagain
Application("sessionDSN")=sConnection
EndSub
SubSession_OnStart
Writethesessioninformationawayintothesessiondatabase
setsession_objADO=Server.CreateObject("ADODB.Connection")
session_objADO.Open(Application("sessionDSN"))
session_sUpdateCmd="insertintosessionvalues
("&Session.SessionID&","
session_sUpdateCmd=session_sUpdateCmd&""&Request.ServerVariables
("REMOTE_ADDR")&","
session_sUpdateCmd=session_sUpdateCmd&""&Request.ServerVariables
("HTTP_USER_AGENT")&");"
session_objADO.Execute(session_sUpdateCmd)
Closethedatabasedownagain
session_objADO.close
setsession_objADO=Nothing
EndSub
SubSession_OnEnd
Deletethesessioninformationfromthesessiondatabase
setsession_objADO=Server.CreateObject("ADODB.Connection")
session_sConnection=Application("sessionDSN")
session_objADO.Open(session_sConnection)
session_sUpdateCmd="delete*fromsessionwhere
SessionID="&Session.SessionID&";"
session_objADO.Execute(session_sUpdateCmd)
Closethedatabasedownagain
session_objADO.close
setsession_objADO=Nothing
EndSub
上面是完成功效的一个例子:
<%OPTIONEXPLICIT
currentusers.aspV1.0
Copyright1998/99BannConsultantsbarryd@bann.co.uk
Created03/11/98Modified03/11/98
On-linedocumentationathttp://www.bann.co.uk/asp/
COPYRIGHTNOTICE
Copyright1998-1999BarryDorransAllRightsReserved.
CurrentUsersmaybeusedandmodifiedfreeofchargebyanyoneso
long
asthiscopyrightnoticeandthecommentsaboveremainintact.By
using
thiscodeyouagreetoindemnifyBarryDorransfromanyliability
that
mightarisefromitsuse.
Sellingthecodeforthisprogramwithoutpriorwrittenconsentis
expresslyforbidden.Inotherwords,pleaseaskfirstbeforeyou
tryand
makemoneyoffofmyprogram.
Obtainpermissionbeforeredistributingthissoftwareoverthe
Internetor
inanyothermedium.Inallcasescopyrightandheadermustremain
intact
%>
<html>
<title>CurrentUserreport</title>
<bodybgcolor="#fffaf0">
<h1>CurrentUserReport</h1>
<br>
<tableborder=0>
<tr><td><p><b>RemoteHost</b></td>
<td><p><b>Browser</b></td></tr>
<%
DIMobjADO,sDatabasePath,sConnection,sessionRecords
DIMuserCount
userCount=0
SETobjADO=Server.CreateObject("ADODB.Connection")
sDatabasePath=Server.MapPath("/databases")
sConnection
="filedsn="&sDatabasePath&"eadonly.dsn;DBQ="&sDatabasePath&"sessio
ns.mdb;"
objADO.Open(sConnection)
SETsessionRecords=objADO.execute("select*fromsession;")
DOWHILENOTsessionRecords.EOF
userCount=userCount+1
%>
<tr><td><p><%=sessionRecords("Host")%></td>
<td><p><%=sessionRecords("BrowserType")%></td></tr>
<%sessionRecords.MoveNext
LOOP
sessionRecords.Close
objADO.close
SETsessionRecords=Nothing
SETobjADO=Nothing
%>
Session变量的无效期默许为20分钟,能够经由过程上面来改动它的默许无效期:
Session.Timeout=(无效期的分钟数)
</p>在实现ERP等高端的ASP应用时,用户需要提供核心的经营资料,需要ASP商有很高的信用度。楼上说交互性不好,太牵强了吧。在微软提供的一套框架中,利用asp做网站,开发效率高,使用人数少,减少不必要的开销。交互性是互动方式,是有开发人员决定的。 |
|