ddc
联网
平面设计 画册 VI欣赏 包装 CG-插画 搜索 个人网页 Alexa排名 CSS 建站资源 下载专区 JS特效 品牌服装 服装院校 专题欣赏 SEO 图标欣赏 专题
上海网站建设 网站建设 域名注册 虚拟主机 广州网站设计 域名注册 广州网站建设 上海网站建设 虚拟主机 广州网页设计 虚拟主机 域名注册 acg ACG玩家 品牌设计
求创科技
网站建设
中国互联
投稿
素材出售
中国设计秀
中资源
当前位置:网络学院首页 >> 编程开发 >> asp >> ASP常用函数收藏+网络咨询页面设计

ASP常用函数收藏+网络咨询页面设计

来源:中国设计秀    作者:    点击:20     加入收藏    发表评论
0
顶一下

'取得IP地址
'************************************
Function Userip()
Dim GetClientIP
'如果客户端用了代理服务器,则应该用ServerVariables("HTTP_X_FORWARDED_FOR")方法
GetClientIP = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
If GetClientIP = "" or isnull(GetClientIP) or isempty(GetClientIP) Then
'如果客户端没用代理,应该用Request.ServerVariables("REMOTE_ADDR")方法
GetClientIP = Request.ServerVariables("REMOTE_ADDR")
end if
Userip = GetClientIP
End function

'************************************
'转换IP地址
'************************************
function cip(sip)
tip=cstr(sip)
sip1=left(tip,cint(instr(tip,".")-1))
tip=mid(tip,cint(instr(tip,".")+1))
sip2=left(tip,cint(instr(tip,".")-1))
tip=mid(tip,cint(instr(tip,".")+1))
sip3=left(tip,cint(instr(tip,".")-1))
sip4=mid(tip,cint(instr(tip,".")+1))
cip=cint(sip1)*256*256*256+cint(sip2)*256*256+cint(sip3)*256+cint(sip4)
end function

'************************************
' 弹出对话框
'************************************
Sub alert(message)
message = replace(message,"'","\'")
Response.Write ("<script>alert('" & message & "')</script>")
End Sub

'************************************
' 返回上一页,一般用在判断信息提交是否完全之后
'************************************
Sub GoBack()
Response.write ("<script>history.go(-1)</script>")
End Sub

'************************************
' 重定向另外的连接
'************************************
Sub Go(url)
Response.write ("<script>location.href('" & url & "')</script>")
End Sub

'************************************
' 指定秒数重定向另外的连接
'************************************
sub GoPage(url,s)
s=s*1000
Response.Write "<SCRIPT LANGUAGE=javascript>"
Response.Write "window.setTimeout("&chr(34)&"window.navigate('"&url&"')"&chr(34)&","&s&")"
Response.Write "</script>"
end sub

'************************************
' 判断数字是否整形
'************************************
function isInteger(para)
on error resume next
dim str
dim l,i
if isNUll(para) then
isInteger=false
exit function
end if
str=cstr(para)
if trim(str)="" then
isInteger=false
exit function
end if
l=len(str)
for i=1 to l
if mid(str,i,1)>"9" or mid(str,i,1)<"0" then
isInteger=false
exit function
end if
next
isInteger=true
if err.number<>0 then err.clear
end function

'************************************
' 获得文件扩展名
'************************************
function GetExtend(filename)
dim tmp
if filename<>"" then
tmp=mid(filename,instrrev(filename,".")+1,len(filename)-instrrev(filename,"."))
tmp=LCase(tmp)
if instr(1,tmp,"asp")>0 or instr(1,tmp,"php")>0 or instr(1,tmp,"php3")>0 or instr(1,tmp,"aspx")>0 then
getextend="txt"
else
getextend=tmp
end if
else
getextend=""
end if
end function

' *-------------------------------------------
' * 函数:CheckIn
' * 描述:检测参数是否有SQL危险字符
' * 参数:str要检测的数据
' * 返回:FALSE:安全 TRUE:不安全
' * 作者:
' * 日期:
' *-------------------------------------------
function CheckIn(str)
if instr(1,str,chr(39))>0 or instr(1,str,chr(34))>0 or instr(1,str,chr(59))>0 then
CheckIn=true
else
CheckIn=false
end if
end function

' *-------------------------------------------
' * 函数:HTMLEncode
' * 描述:过滤HTML代码
' * 参数:--
' * 返回:--
' * 作者:
' * 日期:
' *-------------------------------------------
function HTMLEncode(fString)
if not isnull(fString) then
fString = replace(fString, ">", ">")
fString = replace(fString, "<", "<")

fString = Replace(fString, CHR(32), " ")
fString = Replace(fString, CHR(9), " ")
fString = Replace(fString, CHR(34), """)
fString = Replace(fString, CHR(39), "'")
fString = Replace(fString, CHR(13), "")
fString = Replace(fString, CHR(10) & CHR(10), "</P><P> ")
fString = Replace(fString, CHR(10), "<BR> ")

HTMLEncode = fString
end if
end function

' *-------------------------------------------
' * 函数:HTMLcode
' * 描述:过滤表单字符
' * 参数:--
' * 返回:--
' * 作者:
' * 日期:
' *-------------------------------------------
function HTMLcode(fString)
if not isnull(fString) then
fString = Replace(fString, CHR(13), "")
fString = Replace(fString, CHR(10) & CHR(10), "</P><P>")

2007-09-04 09:59:00    出处:
Google

音乐
嫁衣 画心 放生 天亮了 牡丹江 那滋味 擦肩而过 怀念过去 北京欢迎你 突然好想你 吻的太逼真 说好的幸福呢 坐上火车去拉萨 没有人比我更爱你
愚爱 心碎 稻香 带我走 醉赤壁 魔杰座 我还想她 明天过后 一定要爱你 等爱的玫瑰 原谅我一次 越单纯越幸福 最后一次的温柔 给我一首歌的时间
白狐 光荣 降临 下雨天 小酒窝 樱花草 恋爱新手 说唱脸谱 红色高跟鞋 寂寞才说爱 深深爱过你 爱上你是个错 即使知道要见面 不是因为寂寞才想你
城府 假如 花海 兰亭序 棉花糖 舍不得 最后一次 女人如烟 外滩十八号 我们的纪念 我们的无奈 心在跳情在烧 爱上你是我的错 爱情里没有谁对谁错
网站地图 | 关于我们 | 联系我们 | 网站建设 | 广告服务 | 版权声明 | 免责声明 | 网站公告 | 友情链接 | 留言 | 旧版入口