<% @ Language = "VBScript" codePage = "936" %>
<%
Bytes ----------------------------------------------------------------------------------------
When forwarding, please keep it loose? This statement does not affect your display speed!
************ ****************
Example: IMG. asp? List = image storage directory
Note: The image directory is stored in the same directory as this file! FSO support is required!
Note: As long as you store the changed image in a directory, modify the following Program (to be modified) to your directory name!
Upload this program and the image folder to the same directory, and use the UBB code for posting, for example!
Bytes ----------------------------------------------------------------------------------------
Function allpath ()
Dim domain, gfilepath
Domain = request. servervariables ("SERVER_NAME ")
Gfilepath = request. servervariables ("path_info ")
Gfilepath = lcase (left (gfilepath, limit Rev (gfilepath ,"/")))
Allpath = "<a href = 'HTTP: //" & domain & gfilepath/'target = "_ blank"> HTTP: // "& domain & gfilepath </a> 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
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 "correct parameters need to be introduced on this page. You lack relevant parameters! The correct format is as follows: "& allpath &" IMG. asp? List = (where to modify )"
Response. End ()
End if
Filename = showfilelist ("./" & list &"/")
If filename = "no" then
Response. write "the directory you specified <B>" & list & "</B> does not exist. Please specify it again! "
Response. End ()
End if
If filename = "" then
Response. write "the directory you specified <B>" & list & "</B> does not have a related image file. Please specify it again! "
Response. End ()
End if
STR = right (filename, 3)
If STR <> "jpg" and STR <> "GIF" then
Filename = "erro.gif"
End if
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.