getfiles.asp

来自「一个ASP做的政府网站的全站程序」· ASP 代码 · 共 68 行

ASP
68
字号
<%@LANGUAGE="VBSCRIPT"%>
<html>
<head>
<title>Get Files</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../yuhuan.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
body {
	background-color: #FFFFFF;
}
-->
</style></head>
<script language="JavaScript">
<!--
function addValue(value)
{
	var form = parent.document.photoForm;
	var tempValue = form.photolist.value;		
	var i,j;
		
	if (tempValue.indexOf(value)==-1){	
			form.photolist.value = form.photolist.value + value + "  ";
	}	

	parent.document.images[0].src="../photoes/" + value;

	return;
}

function previewPhoto(str)
{
	parent.document.images[0].src=str;
	return;
}
// -->
</script>
<body >
<%
				  Set objFSO=Server.CreateObject("Scripting.FileSystemObject")
				  path=Server.MapPath("../photoes") & "\"				 
				  Set colFolders = objFSO.GetFolder(path)
				  %>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class=9v  align="center">
  <% dim photolist()
  i=0
  for each colFile in colFolders.Files
	i=i+1
  next
  redim photolist(i)

  i=0
  for each colFile in colFolders.Files
  	photolist(i) = colFile.Name
	i=i+1
  next
  for j=0 to i-1 step 2
  	response.write "<tr>"
	response.write "<td width=15>&nbsp;</td>"
	response.write "<td><a href=javascript:addValue('" & photolist(j) & "') onmouseover=javascript:previewPhoto('../photoes/" & photolist(j) & "') >" & photolist(j) & "</a></td>"
	response.write "<td><a href=javascript:addValue('" & photolist(j+1) & "') onmouseover=javascript:previewPhoto('../photoes/" & photolist(j+1) & "') >" & photolist(j+1) & "</a></td>"
	response.write "</tr>"
  next
  %>  
</table>
</body>
</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?