我是靠谱客的博主 明亮丝袜,这篇文章主要介绍ASP实现头像图像随机变换,现在分享给大家,希望可以做个参考。

复制代码 代码如下:

<%On Error Resume Next%>
<%
dim p, ppic, id, body, myCache
randomize
p=Int((3*rnd)+1)
id= Request.QueryString("id")
HttpUrl="http://sms.2e7.net/可爱卡通0"&p&".gif"
  Set myCache = new cache
  myCache.name = "picindex"&id
  If myCache.valid Then
          body = myCache.value
  Else
          body = GetWebData(HttpUrl)
          myCache.add body,dateadd("d",1,now)
  End If

  If Err.Number = 0 Then
        Response.CharSet = "UTF-8"
        Response.ContentType = "application/octet-stream"
        Response.BinaryWrite body
        Response.Flush
  Else
        Wscript.Echo Err.Description
  End if

'取得数据
Public Function GetWebData(ByVal strid)
Dim cidpath
cidpath = Mid(strid,1,Instr(8,strid,"/"))
Dim Retrieval
Set Retrieval = Server.CreateObject("Microsoft.XMLHTTP")
With Retrieval
.Open "Get", strid, False,"",""
.setRequestHeader "Referer", cidpath
.Send
GetWebData =.ResponseBody
End With
Set Retrieval = Nothing
End Function
%>


最后

以上就是明亮丝袜最近收集整理的关于ASP实现头像图像随机变换的全部内容,更多相关ASP实现头像图像随机变换内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(167)

评论列表共有 0 条评论

立即
投稿
返回
顶部