回复一次图片变一次的原理

 
最近在网上看到了一些图片,回复一次就可以变一次,大家以为很神奇,说穿了其实不值一提。就是利用刷新一次换一次图片的原理。因为回复后页面都会自动刷新。大家先把鼠标放到图片上点右键,点属性,可以看到联接并不是一张图片,而是一个联接到asp页面的链接。呵呵,那我们也做一个asp程序就可以了!
'使用实例:img.asp?list=图片存放目录
'使用注意:图片目录放于本文件同目录下!需要FSO支持!
'说明:只要将变化图片放于一个目录下,修改下面程序的(需要修改的地方)成你的目录名称!
上传本程序和图片文件夹到同一目录下,在发帖时候使用UBB代码形如:即可!
'----------------------------------------------------------------------------------------
Function AllPath()
Dim Domain,GFilePath
Domain = Request.ServerVariables("SERVER_NAME")
GFilePath = Request.ServerVariables("PATH_INFO")
GFilePath = lcase(left(GFilePath,instrRev(GFilePath,"/")))
AllPath = "http://"&Domain&GFilePath
End Function

Function ShowFileList(folderspec)
Dim Path,objFSO,objFolder,count,objFile,nume,S
Path = Server.MapPath(folderspec)
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
If objFSO.FolderExists(Path) Then
Set objFolder = objFSO.GetFolder(Path)
count = 0
For Each objFile in objFolder.Files
count = count+1
Next
randomize
nume = Int((count*rnd)+1)
S = 0
ShowFileList = ""
For Each objFile in objFolder.Files
S = S + 1
If S = nume Then
ShowFileList = objFile.Name
Exit For
End If
Next
Set objFolder = Nothing
Else
ShowFileList = "NO"
End If
Set objFSO = Nothing
End Function

Dim list,2004528115924.htm,address,str

list = trim(Request.QueryString("list"))
if list = "" then
Response.write "本页需要正确参数引入,您缺少相关的参数!正确格式如下:"&AllPath&"img.asp?list=(需要修改的地方)"
Response.End()
end if

2004528115924.htm = ShowFileList("./"&list&"/")
if 2004528115924.htm = "NO" then
Response.write "您指定的目录<b>"&list&"</b>不存在,请重新指定!"
Response.End()
end if

if 2004528115924.htm = "" then
Response.write "您指定的目录<b>"&list&"</b>没有相关的图片文件存在,请重新指定!"
Response.End()
end if

str = right(2004528115924.htm,3)
if str<>"jpg" and str<>"gif" then
2004528115924.htm = "erro.gif"
end if

address = AllPath&list&"/"
address = address&2004528115924.htm
%>
<%Response.redirect(address)%>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值