'===textarea显示用===
function htmlencode1(fString)
if fString<>"" and not isnull(fString) then
fString = replace(fString, ">", ">")
fString = replace(fString, "<", "<")
fString = Replace(fString, " ", chr(32))
fString = Replace(fString, "</p><p>", CHR(10) & CHR(10))
fString = Replace(fString, "<br>", CHR(10))
htmlencode1=fString
else
htmlencode1=""
end if
end function
'===页面显示用===
function htmlencode2(fString)
if fString<>"" and not isnull(fString) then
fString = replace(fString, ">", ">")
fString = replace(fString, "<", "<")
fString = Replace(fString, chr(32), " ")
fString = Replace(fString, CHR(10) & CHR(10), "</p><p>")
fString = Replace(fString, CHR(10), "<br>")
htmlencode2=fString
else
htmlencode2=""
end if
end function
'===取出指定字符串前后的字符串方法===
function GetStrs(str1,CharFlag,Dflag)
dim tmpstr
if Dflag=0 then'取左
pos1=instr(str1,charFlag)
if pos1<=20 then
tmpstr=left(str1,pos1-1)
else
tmpstr=mid(str1,pos1-20,20)
end if
else '取右
pos1=instr(str1,charFlag)+len(charFlag)
if len(str1)-pos1<=20 then
tmpstr=right(str1,len(str1)-pos1)
else
tmpstr=mid(str1,pos1+1,20)
end if
end if
GetStrs=tmpstr
end function
'===取出文件名===
function getfilename(str)
pos=instr(str,".")
if str<>"" then
str=mid(str,pos,len(str))
end if
getfilename=str
end function
'===取到浏览器版本转换字符串===
function browser()
dim text
text = Request.ServerVariables("HTTP_USER_AGENT")
if Instr(text,"MSIE 5.5")>0 then
browser="IE 5.5"
elseif Instr(text,"MSIE 6.0")>0 then
browser="IE 6.0"
elseif Instr(text,"MSIE 5.01")>0 then
browser="IE 5.01"
elseif Instr(text,"MSIE 5.0")>0 then
browser="IE 5.00"
elseif Instr(text,"MSIE 4.0")>0 then
browser="IE 4.01"
else
browser="未知"
end if
end function
'===取到系统脚本转换字符串===
function system(text)
if Instr(text,"NT 5.1")>0 then
system=system+"Windows XP"
elseif Instr(text,"NT 5")>0 then
system=system+"Windows 2000"
elseif Instr(text,"NT 4")>0 then
system=system+"Windows NT4"
elseif Instr(text,"4.9")>0 then
system=system+"Windows ME"
elseif Instr(text,"98")>0 then
system=system+"Windows 98"
elseif Instr(text,"95")>0 then
system=system+"Windows 95"
else
system=system+"未知"
end if
end function
'====删除文件===
function delfile(filepath)
imangepath=trim(filepath)
path=server.MapPath(imangepath)
SET fs=server.CreateObject("Scripting.FileSystemObject")
if FS.FileExists(path) then
FS.DeleteFile(path)
end if
set fs=nothing
end function
'===得到真实的客户端IP===
Public Function GetClientIP()
dim uIpAddr
' 本函数参考webcn.Net/AspHouse 文献<取真实的客户IP>
uIpAddr = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
If uIpAddr = "" Then uIpAddr = Request.ServerVariables("REMOTE_ADDR")
GetClientIP = uIpAddr
uIpAddr = ""
End function
'===取到浏览器版本转换字符串===
function browser()
dim text
text = Request.ServerVariables("HTTP_USER_AGENT")
if Instr(text,"MSIE 5.5")>0 then
browser="IE 5.5"
elseif Instr(text,"MSIE 6.0")>0 then
browser="IE 6.0"
elseif Instr(text,"MSIE 5.01")>0 then
browser="IE 5.01"
elseif Instr(text,"MSIE 5.0")>0 then
browser="IE 5.00"
elseif Instr(text,"MSIE 4.0")>0 then
browser="IE 4.01"
else
browser="未知"
end if
end function
'===取到系统脚本转换字符串===
function system(text)
if Instr(text,"NT 5.1")>0 then
system=system+"Windows XP"
elseif Instr(text,"NT 5")>0 then
system=system+"Windows 2000"
elseif Instr(text,"NT 4")>0 then
system=system+"Windows NT4"
elseif Instr(text,"4.9")>0 then
system=system+"Windows ME"
elseif Instr(text,"98")>0 then
system=system+"Windows 98"
elseif Instr(text,"95")>0 then
system=system+"Windows 95"
else
system=system+"未知"
end if
end function
'====删除文件===
function delfile(filepath)
imangepath=trim(filepath)
path=server.MapPath(imangepath)
SET fs=server.CreateObject("Scripting.FileSystemObject")
if FS.FileExists(path) then
FS.DeleteFile(path)
end if
set fs=nothing
end function
'===得到真实的客户端IP===
Public Function GetClientIP()
dim uIpAddr
' 本函数参考webcn.Net/AspHouse 文献<取真实的客户IP>
uIpAddr = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
If uIpAddr = "" Then uIpAddr = Request.ServerVariables("REMOTE_ADDR")
GetClientIP = uIpAddr
uIpAddr = ""
End function
分享到:
相关推荐
asp常用函数大全 学习asp 制作asp网站必备。
asp常用函数集合
ASP常用函数说明' Z/ w" n- l) j $ ?2 [# j8 u) a+ n Array() 函数说明: 返回一个数组% L5 Y5 ~0 P+ T3 a! u- l' M 语法格式: Array(list) 参数说明: 字符,数字均可$ T" S2 Q9 `! g 代码范例: Dim User=...
ASP 常用函数 集合! 汇总
函数说明: 返回一个数组 语法格式: Array(list) 参数说明: 字符,数字均可 代码范例: Dim User=Array("张三","李四","王五") 返回结果: 建立了一个包含3个元素的数组 CInt() 函数说明: 将一个表达式...
ASP常用函数可打印版 WORD2007格式。
asp常用函数,一些好的功能函数,非常经典
ASP常用函数库,详细介绍了ASP动态服务器页面开发中所使用的各类函数
ASP常用函数库.docASP常用函数库.docASP常用函数库.docASP常用函数库.docASP常用函数库.doc
ASP常用函数库,很多实用的自编函数,满足你的开发需求,绝对经典实用。
asp常用函数,关于asp的常用函数,包括字符串处理,数字处理,以及一些转换函数,从此不用乱找了.
asp常用函数详细说明,几乎所有的ASP函数都在这里
ASP 常用函数30 个,适合于初级的学者, 若是已经对ASP 熟悉的人,可以用它来复习、
ASP常用函数集合[定义].pdf
ASP常用函数,提高开发效率和WEB安全
收集整理的asp常用函数,判断汉字、判断数字、中文字符首字母...
ASP常用函数集合一般网站程序足够用了,获取IP,时间格式化,获取内容第一张图片为缩略图,截取字符串,防XSS攻击过滤等
Array() FUNCTION: 返回一个数组 SYNTAX: Array(list) ARGUMENTS: 字符,数字均可 EXAMPLE: <% Dim myArray() For i = 1 to 7 Redim Preserve myArray(i) myArray(i) = WeekdayName(i)...
搜集的一些asp常用函数。帮助初学者 都是vbscript的,不是javascript
asp常用函数主要包括VBScript 函数 DateValue ( 日期的字符串或表达式 )