<%@ LANGUAGE="VBSCRIPT" %> <% Response.ContentType = "text/html" Response.AddHeader "Content-Type", "text/html;charset=UTF-8" 'Response.CodePage = 65001 Response.CharSet = "UTF-8" response.Expires=15 Response.Buffer=true sub ListFolderContents(path,lang) dim fs, folder, file, item, url, phypath, slashpos, fnom, fline, f, thumb, coun, ii, jj, buffer dim FNames(300) set fs = CreateObject("Scripting.FileSystemObject") phypath=Server.MapPath(Request.ServerVariables("SCRIPT_NAME")) slashpos = instrrev(phypath,"\") phypath = left(phypath,slashpos-1) slashpos = instrrev(phypath,"\") phypath = left(phypath,slashpos-1)&"\albumphoto" set folder = fs.GetFolder(phypath) 'Display a list of .jpg files. coun=0 for each item in folder.Files if UCase(Right(item.Name,4)) = ".JPG" then if Left(item.Name,3) <> "th_" then fNames(coun)=item.name coun=coun+1 end if end if if coun=0 then url = MapURL(item.path) slashpos = instrrev(item.path,"\") end if next for ii=0 to coun for jj= ii+1 to coun if strComp(fNames(ii),fNames(jj),0)=1 then buffer = fNames(jj) fNames(jj) = fNames(ii) fNames(ii) = buffer end if next next jj=0 for ii=1 to coun thumb = "../albumphoto/th_"&fNames(ii) fline="" fnom = Left(fNames(ii),Len(fNames(ii))-4)&".txt" if fs.FileExists(phypath&"\"&lang&"\"&fnom) then set f = fs.opentextfile(phypath&"\"&lang&"\"&fnom, 1, false, 0) while not f.atEndOfStream fline = f.readline wend fline=Replace(fline,"'","´") end if Response.Write("
" ) response.write "
"&fline response.write "
" jj=jj+1 if jj=4 then response.write "
" jj=0 end if next end sub function MapURL(path) dim rootPath, url 'Convert a physical file path to a URL for hypertext links. rootPath = Server.MapPath("/") url = Right(path, Len(path) - Len(rootPath)) MapURL = Replace(url, "\", "/") end function %>

<% response.write "放大请点击图片" %>

<% Call ListFolderContents("albumphoto","chin") %>