手机
当前位置:查字典教程网 >编程开发 >ASP教程 >ASP实现头像图像随机变换
ASP实现头像图像随机变换
摘要:复制代码代码如下:

复制代码 代码如下:

<%OnErrorResumeNext%>

<%

dimp,ppic,id,body,myCache

randomize

p=Int((3*rnd)+1)

id=Request.QueryString("id")

HttpUrl="http://sms.2e7.net/可爱卡通0"&p&".gif"

SetmyCache=newcache

myCache.name="picindex"&id

IfmyCache.validThen

body=myCache.value

Else

body=GetWebData(HttpUrl)

myCache.addbody,dateadd("d",1,now)

EndIf

IfErr.Number=0Then

Response.CharSet="UTF-8"

Response.ContentType="application/octet-stream"

Response.BinaryWritebody

Response.Flush

Else

Wscript.EchoErr.Description

Endif

'取得数据

PublicFunctionGetWebData(ByValstrid)

Dimcidpath

cidpath=Mid(strid,1,Instr(8,strid,"/"))

DimRetrieval

SetRetrieval=Server.CreateObject("Microsoft.XMLHTTP")

WithRetrieval

.Open"Get",strid,False,"",""

.setRequestHeader"Referer",cidpath

.Send

GetWebData=.ResponseBody

EndWith

SetRetrieval=Nothing

EndFunction

%>

【ASP实现头像图像随机变换】相关文章:

ASP中七种实现分页显示的方法

ASP中字符与数字操作函数总结

如何用ASP代码实现虚拟主机

asp中实现随机分组程序的代码

ASP实现SQL备份、恢复

ASP中怎么实现SQL数据库备份、恢复!

ASP代码实现图片上传并存入数据库中

用ASP+DLL实现WEB方式修改服务器时间

[图]Flash+ASP实现电子互动地图在线标注功能

用ASP实现hashMap功能的类

精品推荐
分类导航