用ASP等编程语句作几个图片连接指向,每刷新一次即按顺序更改连接指向每刷新一次页面变化一个新图片的方法第1步,新建一个img.asp文件,代码如下: <%@LANGUAGE="VBscript" CODEPAGE="936"%> <% 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,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 "您指定的目录"&list&"不存在,请重新指定!" Response.End() end if if filename = "" then Response.write "您指定的目录"&list&"没有相关的图片文件存在,请重新指定!" 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)%>再新建一个pic文件夹,存放你已经准备雀源好的几张图片,大小最好一样,用一下代码放到网页立即可
相关文章
-
图片中咸丰重宝当十铜钱值多少钱?
2023-07-22 16:25 阅读(636) -
图片如何生成二维码
2023-07-03 00:15 阅读(580) -
图片猜成语及答案大全
2023-06-11 11:26 阅读(553)