|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
SQL Server是基于服务器端的中型的数据库,可以适合大容量数据的应用,在功能上管理上也要比Access要强得多。在处理海量数据的效率,后台开发的灵活性,可扩展性等方面强大。统计 <%
<Script Language = "VBScript" RunAt = "Server">
Function DealIP(srcIP)
Dim lngIP, aryIP, I
lngIP = 0
aryIP = Split(srcIP, ".")
If UBound(aryIP) <> 3 Then
DealIP = 0
Exit Function
End If
For I = 0 To 3
lngIP = lngIP + (CInt(aryIP(I)) * (256 ^ (3 - I)))
Next
DealIP = lngIP - 1
If Err Then DealIP = 0
End Function
<!--METADATA TYPE="typelib" uuid="00000205-0000-0010-8000-00AA006D2EA4" -->
Sub Statistics_Add()
Session("IsRecorded") = False
Session("sttPage") = Request.ServerVariables("SCRIPT_NAME")
Session("refPage") = Request.ServerVariables("HTTP_REFERER")
If Not Session("IsRecorded") Then
Dim objConn, objRS, strSQL
Dim IEVersion, IPAddress, VisitDate, VisitTime, IPAddressDeal, tmpID
Dim sttPage, refPage
IEVersion = Request.ServerVariables("HTTP_USER_AGENT")
IPAddress = Request.ServerVariables("REMOTE_ADDR")
VisitDate = Date()
VisitTime = Time()
sttPage = Session("sttPage")
refPage = Session("refPage")
Set objConn = Server.CreateObject("ADODB.Connection")
With objConn
' 数据库毗连,字符串自定
.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("... ...")
.Open
End With
IPAddressDeal = DealIP(CStr(IPAddress))
Set objRS = Server.CreateObject("ADODB.Recordset")
With objRS
.ActiveConnection = objConn
.CursorType = adOpenForwardOnly
.LockType = adLockReadOnly
.Source = "Select * From IPDatas Where IP_Lower <= " & IPAddressDeal & " And IP_Upper >= " & IPAddressDeal
.Open
End With
If objRS.EOF Then
tmpID = 29510
Else
tmpID = objRS("IP_ID")
End If
objRS.Close
With objRS
.ActiveConnection = objConn
.CursorType = adOpenForwardOnly
.LockType = adLockPessimistic
.Source = "Select * From IPs"
.Open
.AddNew
.Fields.Item("IEVersion") = IEVersion
.Fields.Item("IPAddress") = IPAddress
.Fields.Item("IP_ID") = tmpID
.Fields.Item("VisitDate") = VisitDate
.Fields.Item("VisitTime") = VisitTime
.Fields.Item("sttPage") = sttPage
.Fields.Item("refPage") = refPage
.Update
End With
objRS.Close
Set objRS = Nothing
objConn.Close
Set objConn = Nothing
Session("IsRecorded") = True
End If
End Sub
Sub Application_OnStart()
Application("NowOnline") = 0
End Sub
Sub Session_OnStart()
Session.TimeOut = 20
Session("IsRecordedCCCNet") = False
Call Statistics_Add
Application.Lock
Application("NowOnline") = Application("NowOnline") + 1
Application.UnLock
End Sub
Sub Session_OnEnd()
Application.Lock
Application("NowOnline") = Application("NowOnline") - 1
Application.UnLock
End Sub
</Script>
%>
</p> 专业性的服务。有的ASP商提供垂直型的应用服务,针对某一特定行业提供应用服务。 |
|