» 您尚未 登录   注册 | 社区服务 | 在线音乐 | 帮助 | 转贴工具 | 社区 | 无图版

五颜六色论坛 -> 电脑学校 -> ASP百变图代码 [实用收藏]
 XML   RSS 2.0   WAP 

常州五颜六色网络技术有限公司 五颜六色网 五颜六色网-Flash欣赏 五颜六色-在线音乐
五颜六色网诚聘市场营销人员(全职) 本论坛QQ群8375513,欢迎加入

--> 本页主题: ASP百变图代码 [实用收藏] 加为IE收藏 | 收藏主题 | 上一主题 | 下一主题
阿七

终身成就奖
头衔:老婆不在家老婆不在家
该用户目前不在线
级别: 总版主
精华: 11
发帖: 8334
威望: 93 点
金钱: 8054 RMB
贡献值: 220 点
在线时间:2286(小时)
注册时间:2003-10-08
最后登录:2008-09-18
查看作者资料 发送短消息 推荐此帖 引用回复这个帖子


ASP百变图代码 [实用收藏]

asp源码 d"~(T:=r  
   =y%rG :!  
  ************************* 随机图片显示 **************************** zzZg$9PT[  
  '使用实例:img.asp?list=图片存放目录 8 Op.eYe  
  '使用注意:图片目录放于本文件同目录下!需要FSO支持! :Gh~fm3}  
  '说明:只要将变化图片放于一个目录下,修改下面程序的(需要修改的地方)成你的目录名称! $ v} <'  
  上传本程序和图片文件夹到同一目录下,在发帖时候使用UBB代码形如:即可! Di=9mHC  
  '---------------------------------------------------------------------------------------- .d q "k  
  Function AllPath() xi'<y  
  Dim Domain,GFilePath x:5dC I  
  Domain = Request.ServerVariables("SERVER_NAME") FfMnul  
  GFilePath = Request.ServerVariables("PATH_INFO") q42FP q  
  GFilePath = lcase(left(GFilePath,instrRev(GFilePath,"/"))) }fIqH4bp  
  AllPath = "http://"&Domain&GFilePath xRDi Rj  
  End Function FWPW/oC  
   Q e1oT)  
  Function ShowFileList(folderspec) o;J;*~g  
  Dim Path,objFSO,objFolder,count,objFile,nume,S -S; &Q'Mt  
  Path = Server.MapPath(folderspec) Li`hdrO'ii  
  Set objFSO = Server.CreateObject("Scripting.FileSystemObject") 17py ).\  
  If objFSO.FolderExists(Path) Then }. %s xw  
  Set objFolder = objFSO.GetFolder(Path) 2mJ:c  
  count = 0 zS% m_,t  
  For Each objFile in objFolder.Files t*+! n.p  
  count = count+1 z Bf;fi  
  Next e`DsP8-&v  
  randomize pv$tTWk  
  nume = Int((count*rnd)+1) U6i~A9;  
  S = 0 sC6r.@[u8t  
  ShowFileList = "" Ve:&'~F2 s  
  For Each objFile in objFolder.Files a"qR J-@  
  S = S + 1 YeIe\3x!N  
  If S = nume Then ` !kL1oUYE  
  ShowFileList = objFile.Name j7sU0"7^  
  Exit For ;qVG \wQq  
  End If ,^+#M{Z  
  Next {_ 6t4h}  
  Set objFolder = Nothing nh.b/\o  
  Else Q2R-z^pd  
  ShowFileList = "NO" z6}Pj>1  
  End If P7Z<0Dt\}  
  Set objFSO = Nothing Uk"Y/Ddm  
  End Function iiehrK&T !  
   ox JGJ  
  Dim list,2004528115924.htm,address,str y $v@wb5  
   >EeAPO4  
  list = trim(Request.QueryString("list")) ,? #*eJD  
  if list = "" then [M<{P5q  
  Response.write "本页需要正确参数引入,您缺少相关的参数!正确格式如下:"&AllPath&"img.asp?list=(需要修改的地方)" $KH@,;Xz  
  Response.End() u,!4vKx  
  end if XzN-slu!  
   K#iK6)tS  
  2004528115924.htm = ShowFileList("./"&list&"/") s?~8O|Mu'  
  if 2004528115924.htm = "NO" then o9~h%&  
  Response.write "您指定的目录<b>"&list&"</b>不存在,请重新指定!" &l?N:(r  
  Response.End() u% r!?-z  
  end if %zRiLcAT  
   {rtM%%l  
  if 2004528115924.htm = "" then ./'; P <)  
  Response.write "您指定的目录<b>"&list&"</b>没有相关的图片文件存在,请重新指定!" DXt]b,  
  Response.End() D l4d'&!  
  end if 8H&_,;  
   ,^n-L&  
  str = right(2004528115924.htm,3) Y1m}@k,+M  
  if str<>"jpg" and str<>"gif" then QQ5lW  
  2004528115924.htm = "erro.gif" %H 8A=  
  end if ]u\  `  
   MT;SRAmUr  
  address = AllPath&list&"/" lNq:JVJ#\r  
  address = address&2004528115924.htm j ` [#Ij  
  %> E1$Hu{  
  <%Response.redirect(address)%>

[楼 主] | Posted: 2006-05-04 10:42 顶端

五颜六色论坛 -> 电脑学校



[ 五颜六色网 ]
Copyright © 2003-2008 5y6s.net 苏ICP备05001866号 Powered by PHPWind 5.0.1
会员言论不代表本站立场 本站法律顾问:北京汇泽律师事务所 韩律师
Total 0.023915(s) query 4, Gzip enabled