Example Code:
example 1: show all images in a folder
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>show image files</title>
</head>
<body>
<%
whereimages=Server.MapPath("\image_folder\")
response.write whereimages &"<hr>"
dim countI,objFSO,objFolder,objFile,objOpen
countI=0
Set objFSO=Server.CreateObject("Scripting.FileSystemObject")
Set objFolder=objFSO.GetFolder(whereimages)
for Each objFile in objFolder.Files
if countI<100 then
if right(objFile,4)=".jpg" or right(objFile,4)=".gif" then
countI=countI+1
if countI>0 then
Response.Write countI&" : <img src=http://self_domain_com/image_folder/"& objFile.Name & ">"
end if
end if
end if
Next
Set objOpen=nothing
Set objFolder=nothing
Set objFSO=nothing
%>
</body>
</html>
example 2:
< %= server.mappath(Request.ServerVariables("PATH_INFO"))%>
|