小李飞帖 2007-5-21 07:03
神奇的百变美女源码公开
[color=black]在很多BBS里看到有人发百变美女的帖子,发帖的人一般会给你说回复一次美女变一个或者换个动作,你回复了一下,果然变了.这样的帖子很快就成了热帖了,推广网站很有用的,哈哈,这么神奇的功能是怎么实现的呢,下面小李飞帖在天梯网公开一下源码,
不知道现在这个方法还有效不,不过,这个功能还可以做很多的发挥~,比如百变首页......,具体如何发挥要看大家的想象力和创造性了,呵呵
[WIKI]ASP[/wiki]源码:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%
'----------------------------------------------------------------------------------------
'使用实例:空间地址名/文件夹名/tntbbs.ASP?list=图片存放目录
'使用注意:图片目录放于本文件同目录下!需要FSO支持!
'小李飞帖首发于[/color][URL=http://www.tntbbs.com][color=black]天梯网站策划论坛[/color][/url][color=black]: [/color][url=http://www.tntbbs.com][color=black]www.tntbbs.com[/color][/url][color=black] 转载注明 否则必究
'----------------------------------------------------------------------------------------
Function AllPath()
Dim Domain,GFilePath
Domain = R[wiki]EQ[/wiki]uest.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
Ex[wiki]IT[/wiki] For
End If
Next
Set objFolder = Nothing
Else
ShowFileList = "NO"
End If
Set objFSO = Nothing
End Function
Dim list,filename,address,str
list = trim(Request.QueryString("list"))
if list = "" then
Response.write "本页需要正确参数引入,您缺少相关的参数!正确格式如下:"&AllPath&"img.asp?list=图片存放目录"
Response.End()
end if
filename = ShowFileList("./"&list&"/")
if filename = "NO" then
Response.write "您指定的目录<b>"&list&"</b>不存在,请重新指定!"
Response.End()
end if
if filename = "" then
Response.write "您指定的目录<b>"&list&"</b>没有相关的图片文件存在,请重新指定!"
Response.End()
end if
str = right(filename,3)
if str<>"jpg" and str<>"gif" then
filename = "erro.gif"
end if
address = AllPath&list&"/"
address = address&filename
%>
<%Response.redirect(address)%>
把上面的源码复制到记事本,存为tntbbs.asp就可以用了,已经全部公开了,不要再问我怎么用啊~
[/color]
[[i] 本帖最后由 小李飞帖 于 2007-3-6 21:41 编辑 [/i]]