源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

ASP实现头像图像随机变换

  • 时间:2021-09-14 02:08 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:ASP实现头像图像随机变换
[u]复制代码[/u] 代码如下:
<%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 %>
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部