揭秘asp常用函數(shù)庫大全_ASP教程
教程Tag:暫無Tag,歡迎添加,賺取U幣!
推薦:詳解將ASP頁面改為偽靜態(tài)的簡(jiǎn)單方法目前很多網(wǎng)站都采用生成靜態(tài)頁的方法,原因是這樣訪問速度會(huì)得到提高(服務(wù)器端CPU利用率很低),另外也容易被搜索引擎收錄,但是這帶來的一個(gè)問題就是需要足夠大的空間存放這些靜態(tài)頁面,如果你的空間不是很富裕,而又想有利于被搜索引擎收錄,其實(shí)可以采用偽
’----------------- FLYSO Blog ASP站點(diǎn)開發(fā)常用函數(shù)庫 ------------------’OpenDB(vdata_url) -------------------- 打開數(shù)據(jù)庫
’getIp() ------------------------------- 得到真實(shí)IP
’getIPAdress(sip)------------------------ 查找ip對(duì)應(yīng)的真實(shí)地址
’IP2Num(sip) ---------------------------- 限制某段IP地址
’chkFrom() ------------------------------ 防站外提交設(shè)定
’getsys() ------------------------------- 操作系統(tǒng)檢測(cè)
’GetBrowser() --------------------------- 瀏覽器版本檢測(cè)
’GetSearcher() -------------------------- 識(shí)別搜索引擎
’
’---------------------- 數(shù)據(jù)過濾 ↓----------------------------
’CheckStr(byVal ChkStr) ----------------- 檢查無效字符
’CheckSql() ----------------------------- 防止SQL注入
’UnCheckStr(Str)------------------------- 檢查非法sql命令
’Checkstr(Str) -------------------------- ASP最新SQL防注入過濾涵數(shù)
’HTMLEncode(reString) ------------------- 過濾轉(zhuǎn)換HTML代碼
’DateToStr(DateTime,ShowType) ----------- 日期轉(zhuǎn)換函數(shù)
’Date2Chinese(iDate) -------------------- 獲得ASP的中文日期字符串
’lenStr(str) ---------------------------- 計(jì)算字符串長度(字節(jié))
’CreateArr(str) ------------------------- 生成二維數(shù)組
’ShowRsArr(rsArr) ----------------------- 用表格顯示記錄集getrows生成的數(shù)組的表結(jié)構(gòu)
’---------------------- 外接組件使用函數(shù)↓------------------------
’sendMail(to_Email,from_Email,from_Name,mail_Subject,mail_Body,mail_htmlBody) -----’Jmail組件 發(fā)送郵件
’-----------------------------------------系統(tǒng)檢測(cè)函數(shù)↓------------------------------------------
’IsValidUrl(url) ------------------------ 檢測(cè)網(wǎng)頁是否有效
’getHTMLPage(filename) ------------------ 獲取文件內(nèi)容
’CheckFile(FilePath) -------------------- 檢查某一文件是否存在
’CheckDir(FolderPath) ------------------- 檢查某一目錄是否存在
’MakeNewsDir(foldername) ---------------- 根據(jù)指定名稱生成目錄
’CreateHTMLPage(filename,FileData,C_mode) 生成文件
’CheckBadWord(byVal ChkStr) ------------- 過濾臟字
’###############################################################
Dim ipData_url
ipData_url="./Ip.mdb"
Response.Write("--------------客戶端信息檢測(cè)------------"&"<br>")
Response.Write(getsys()&"<br>")
Response.Write(GetBrowser()&"<br>")
Response.Write(GetSearcher()&"<br>")
Response.Write("IP:"&getIp()&"<br>")
Response.Write("來源:"&(getIPAdress(GetIp()))&"<br>")
Response.Write("<br>")
Response.Write("--------------數(shù)據(jù)提交檢測(cè)--------------"&"<br>")
if not chkFrom then
Response.write("請(qǐng)不要從站外提交內(nèi)容!"&"<br>")
Response.end
else
Response.write("本站提交內(nèi)容!"&"<br><br>")
End if
function OpenDB(vdata_url)
’------------------------------打開數(shù)據(jù)庫
’使用:Conn = OpenDB("data/data.mdb")
Dim vibo_Conn
Set vibo_Conn= Server.CreateObject("ADODB.Connection")
vibo_Conn.ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(vdata_url)
vibo_Conn.Open
OpenDB=vibo_Conn
End Function
function getIp()
’-----------------------得到真實(shí)IP
userip = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
If userip = "" Then userip = Request.ServerVariables("REMOTE_ADDR")
getIp=userip
End function
Function getIPAdress(sip)
’---------------------查找ip對(duì)應(yīng)的真實(shí)地址
Dim iparr,iprs,country,city
If sip="127.0.0.1" then sip= "192.168.0.1"
iparr=split(sip,".")
sip=cint(iparr(0))*256*256*256+cint(iparr(1))*256*256+cint(iparr(2))*256+cint(iparr(3))-1
Dim vibo_ipconn_STRING
vibo_ipconn_STRING = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&Server.MapPath(ipData_url)
Set iprs = Server.CreateObject("ADODB.Recordset")
iprs.ActiveConnection = vibo_ipconn_STRING
iprs.Source = "Select Top 1 city, country FROM address Where ip1 <=" & sip & " and " & sip & "<=ip2"
iprs.CursorType = 0
iprs.CursorLocation = 2
iprs.LockType = 1
iprs.Open()
If iprs.bof and iprs.eof then
country="未知地區(qū)"
city=""
Else
country=iprs.Fields.Item("country").Value
city=iprs.Fields.Item("city").Value
End If
getIPAdress=country&city
iprs.Close()
Set iprs = Nothing
End Function
分享:解析有關(guān)eWebEditor網(wǎng)頁編輯器的漏洞首先介紹編輯器的一些默認(rèn)特征: 默認(rèn)登陸admin_login.asp 默認(rèn)數(shù)據(jù)庫db/ewebeditor.mdb 默認(rèn)帳號(hào)admin密碼admin或admin888 在baidu/google搜索inurl:ewebeditor 幾萬的站起碼有幾千個(gè)是具有默認(rèn)特征的,那么試一下默認(rèn)后臺(tái) http://www.xxx.com.cn/admin/eweb
相關(guān)ASP教程:
- asp FSO 讀寫文件本文件實(shí)現(xiàn)代碼
- asp中isNull、isEmpty和空字符串的區(qū)別
- asp獲取用戶真實(shí)IP地址的方法
- asp連接sqlserver數(shù)據(jù)庫實(shí)現(xiàn)代碼
- asp中正則表達(dá)式過濾html代碼函數(shù)
- asp中g(shù)et post提交表單區(qū)別
- 網(wǎng)頁模板:ASP內(nèi)建對(duì)象Request
- xmlhttp的open方法使用詳解
- ASP的常用的自定義函數(shù)大全
- asp中用for循環(huán)的一個(gè)小技巧
- eWebEditor v3.8 列目錄
- ASP無組件分頁實(shí)現(xiàn)思路及代碼
- 相關(guān)鏈接:
- 教程說明:
ASP教程-揭秘asp常用函數(shù)庫大全
。