ASP調(diào)用純真IP庫(kù)實(shí)例(3)_ASP教程
教程Tag:暫無(wú)Tag,歡迎添加,賺取U幣!
推薦:ASP實(shí)例:ASP實(shí)現(xiàn)空間的最近訪客由于工作關(guān)系,在做一個(gè)用戶空間。要用到空間的最近訪客,見ASP代碼: % username=request.QueryString(username) '地欄中的username,就是自己的用戶名了 if trim(request.Cookies(user_name)) Then '首頁(yè)要判斷該訪問(wèn)是否登陸,只有登陸的訪問(wèn)才能記
' ============================================
' 獲取結(jié)束IP位置
' ============================================
Private Function GetEndIP()
Stream.Position = EndIPOff
Buf = Stream.Read(5)
EndIP = AscB(MidB(Buf, 1, 1)) + (AscB(MidB(Buf, 2, 1))*256) + (AscB(MidB(Buf, 3, 1))*256*256) + (AscB(MidB(Buf, 4, 1))*256*256*256)
CountryFlag = AscB(MidB(Buf, 5, 1))
GetEndIP = EndIP
End Function
' ============================================
' 獲取地域信息,包含國(guó)家和和省市
' ============================================
Private Sub GetCountry(IP)
If (CountryFlag = 1 Or CountryFlag = 2) Then
Country = GetFlagStr(EndIPOff + 4)
If CountryFlag = 1 Then
LocalStr = GetFlagStr(Stream.Position)
' 以下用來(lái)獲取數(shù)據(jù)庫(kù)版本信息
If IP >= IPToInt("255.255.255.0") And IP <= IPToInt("255.255.255.255") Then
LocalStr = GetFlagStr(EndIPOff + 21)
Country = GetFlagStr(EndIPOff + 12)
End If
Else
LocalStr = GetFlagStr(EndIPOff + 8)
End If
Else
Country = GetFlagStr(EndIPOff + 4)
LocalStr = GetFlagStr(Stream.Position)
End If
' 過(guò)濾數(shù)據(jù)庫(kù)中的無(wú)用信息
Country = Trim(Country)
LocalStr = Trim(LocalStr)
If InStr(Country, "CZ88.NET") Then Country = ""
If InStr(LocalStr, "CZ88.NET") Then LocalStr = ""
End Sub
' ============================================
' 獲取IP地址標(biāo)識(shí)符
' ============================================
Private Function GetFlagStr(OffSet)
Dim Flag
Flag = 0
Do While (True)
Stream.Position = OffSet
Flag = AscB(Stream.Read(1))
If(Flag = 1 Or Flag = 2 ) Then
Buf = Stream.Read(3)
If (Flag = 2 ) Then
CountryFlag = 2
EndIPOff = OffSet - 4
End If
OffSet = AscB(MidB(Buf, 1, 1)) + (AscB(MidB(Buf, 2, 1))*256) + (AscB(MidB(Buf, 3, 1))*256*256)
Else
Exit Do
End If
Loop
If (OffSet < 12 ) Then
GetFlagStr = ""
Else
Stream.Position = OffSet
GetFlagStr = GetStr()
End If
End Function
分享:ASP防止GET,Post注入和防止服務(wù)器攻擊,并記錄IP% '防止GET,Post注入和防止服務(wù)器攻擊 '使用方法把本文件包含到需要防注的文件就OK了,說(shuō)明下,這里的post攻擊和Get攻擊不一定是攻擊,在英文版本的時(shí)候請(qǐng)注意使用 '馮旭修改 session.Abandon() Dim fxjt111_Attack_post,fxjt111_Attack_Get,fxjt111_Attack_Sys
相關(guān)ASP教程:
- asp FSO 讀寫文件本文件實(shí)現(xiàn)代碼
- asp中isNull、isEmpty和空字符串的區(qū)別
- asp獲取用戶真實(shí)IP地址的方法
- asp連接sqlserver數(shù)據(jù)庫(kù)實(shí)現(xiàn)代碼
- asp中正則表達(dá)式過(guò)濾html代碼函數(shù)
- asp中g(shù)et post提交表單區(qū)別
- 網(wǎng)頁(yè)模板:ASP內(nèi)建對(duì)象Request
- xmlhttp的open方法使用詳解
- ASP的常用的自定義函數(shù)大全
- asp中用for循環(huán)的一個(gè)小技巧
- eWebEditor v3.8 列目錄
- ASP無(wú)組件分頁(yè)實(shí)現(xiàn)思路及代碼
ASP教程Rss訂閱編程教程搜索
ASP教程推薦
- asp常見錯(cuò)誤分析和解決辦法
- ASP 3.0高級(jí)編程(三十八)
- 有用的無(wú)聲遞交表單的客戶端函數(shù)
- 淺析ASP-server.URLEncode反函數(shù):urldecode
- ASP實(shí)例:讀取xml文件的程序
- 做網(wǎng)頁(yè)常用ASP函數(shù)
- 解讀ASP+SQL的存儲(chǔ)過(guò)程簡(jiǎn)單入門
- ASP入門:認(rèn)識(shí)ASP程序所使用的幾種腳本語(yǔ)言
- 學(xué)ASp動(dòng)態(tài)網(wǎng)頁(yè)必備:常用的38個(gè)函數(shù)
- ASP實(shí)現(xiàn)在提交表單到數(shù)據(jù)庫(kù)的同時(shí)發(fā)郵件通知
- 相關(guān)鏈接:
- 教程說(shuō)明:
ASP教程-ASP調(diào)用純真IP庫(kù)實(shí)例(3)
。