婷婷综合国产,91蜜桃婷婷狠狠久久综合9色 ,九九九九九精品,国产综合av

主頁 > 知識庫 > asp仿php的一些函數分享

asp仿php的一些函數分享

熱門標簽:武穴地圖標注 世界地圖標注了哪些城市 地圖標注陽江 java外呼系統是什么 外呼線路批發 梧州市地圖標注 創意電話機器人 濟源電銷外呼系統線路 石家莊慧營銷外呼系統
復制代碼 代碼如下:

'過程:輸出字符串[代替Response.Write]

Sub echo(Str)
response.Write(Str)
End Sub

'函數:獲取表單[代替Request.Form]

Function reqf(Str)
reqf = Request.Form(Str)
End Function

'過程:結束頁面并輸出字符串

Sub die(Str)
response.Write(Str)
response.End()
End Sub

'函數:將ASP文件運行結果返回為字串

Function ob_get_contents(Path)
Dim tmp, a, b, t, matches, m
Dim Str
Str = file_iread(Path)
tmp = "dim htm : htm = """""vbCrLf
a = 1
b = InStr(a, Str, "%") + 2
While b > a + 1
t = Mid(Str, a, b - a -2)
t = Replace(t, vbCrLf, "{::vbcrlf}")
t = Replace(t, vbCr, "{::vbcr}")
t = Replace(t, """", """""")
tmp = tmp "htm = htm """ t """" vbCrLf
a = InStr(b, Str, "%\&;") + 2
tmp = tmp str_replace("^\s*=", Mid(Str, b, a - b -2), "htm = htm ") vbCrLf
b = InStr(a, Str, "%") + 2
Wend
t = Mid(Str, a)
t = Replace(t, vbCrLf, "{::vbcrlf}")
t = Replace(t, vbCr, "{::vbcr}")
t = Replace(t, """", """""")
tmp = tmp "htm = htm """ t """" vbCrLf
tmp = Replace(tmp, "response.write", "htm = htm ", 1, -1, 1)
tmp = Replace(tmp, "echo", "htm = htm ", 1, -1, 1)
'execute(tmp)
executeglobal(tmp)
htm = Replace(htm, "{::vbcrlf}", vbCrLf)
htm = Replace(htm, "{::vbcr}", vbCr)
ob_get_contents = htm
End Function

'過程:動態包含文件

Sub include(Path)
echo ob_get_contents(Path)
End Sub

'函數:base64加密

Function base64encode(byval Str)
If IsNull(Str) Then Exit Function
Dim base64
Set base64 = New base64_class
Str = base64.encode(Str)
Set base64 = Nothing
base64encode = Str
End Function

'函數:base64解密

Function base64decode(byval Str)
If IsNull(Str) Then Exit Function
Dim base64
Set base64 = New base64_class
Str = base64.decode(Str)
Set base64 = Nothing
base64decode = Str
End Function

'函數:URL加密

Function urlencode(byval Str)
If IsNull(Str) Then Exit Function
Str = server.URLEncode(Str)
urlencode = Str
End Function

'函數:Escape加密

Function escape(byval Str)
If IsNull(Str) Then Exit Function
Dim i, c, a, tmp
tmp = ""
For i = 1 To Len(Str)
c = Mid(Str, i, 1)
a = ascw(c)
If (a>= 48 And a= 57) Or (a>= 65 And a= 90) Or (a>= 97 And a= 122) Then
tmp = tmp c
ElseIf InStr("@*_+-./", c) > 0 Then
tmp = tmp c
ElseIf a>0 And a16 Then
tmp = tmp "%0" Hex(a)
ElseIf a>= 16 And a256 Then
tmp = tmp "%" Hex(a)
Else
tmp = tmp "%u" Hex(a)
End If
Next
escape = tmp
End Function

'函數:Escape解密

Function unescape(byval Str)
If IsNull(Str) Then Exit Function
Dim i, c, tmp
tmp = ""
For i = 1 To Len(Str)
c = Mid(Str, i, 1)
If Mid(Str, i, 2) = "%u" And i= Len(Str) -5 Then
If IsNumeric("H" Mid(Str, i + 2, 4)) Then
tmp = tmp chrw(CInt("H" Mid(Str, i + 2, 4)))
i = i + 5
Else
tmp = tmp c
End If
ElseIf c = "%" And i= Len(Str) -2 Then
If IsNumeric("H" Mid(Str, i + 1, 2)) Then
tmp = tmp chrw(CInt("H" Mid(Str, i + 1, 2)))
i = i + 2
Else
tmp = tmp c
End If
Else
tmp = tmp c
End If
Next
unescape = tmp
End Function

標簽:揭陽 甘南 南寧 迪慶 來賓 淮北 滁州 唐山

巨人網絡通訊聲明:本文標題《asp仿php的一些函數分享》,本文關鍵詞  asp,仿,php,的,一些,函數,;如發現本文內容存在版權問題,煩請提供相關信息告之我們,我們將及時溝通與處理。本站內容系統采集于網絡,涉及言論、版權與本站無關。
  • 相關文章
  • 下面列出與本文章《asp仿php的一些函數分享》相關的同類信息!
  • 本頁收集關于asp仿php的一些函數分享的相關信息資訊供網民參考!
  • 推薦文章
    主站蜘蛛池模板: 辛集市| 巴林左旗| 古交市| 莱西市| 高尔夫| 自治县| 乃东县| 玛多县| 龙南县| 武乡县| 徐汇区| 福建省| 南皮县| 灵川县| 广宁县| 体育| 乾安县| 滕州市| 石门县| 贵州省| 衡南县| 若羌县| 门源| 三原县| 肇庆市| 宜川县| 开江县| 平顺县| 稻城县| 衡水市| 固始县| 阿克陶县| 定结县| 临湘市| 英吉沙县| 奈曼旗| 根河市| 东辽县| 南和县| 永胜县| 隆安县|