⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 browse.asp

📁 可在线管理ACCESS数据库,可新建,修改,建表等如同本地操作数据库
💻 ASP
字号:
<%@ Language=VBScript %>
<!--#include file=scripts/inc_common.asp -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name=vs_targetSchema content="http://schemas.microsoft.com/intellisense/ie5">
<meta NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<link rel="stylesheet" href="default.css" type="text/css">
<title><%=langBrowse%></title>
<script LANGUAGE="javascript">
<!--
function pickFile(s){
	if(window.opener != null && window.opener != 'undefined'){
		window.opener.document.getElementById("iPath").value = s;
		window.close();
	}else{
		prompt("<%=langOldBrowser%>",s);
		window.close();
	}
}
function onDriveChange(drive){
	if(drive.length > 0){
		var s = drive;
		if(s.lastIndexOf("\\") != s.length-1)
			s += "\\";
		document.location.replace("browse.asp?dir=" + escape(s));
	}
}
function EditPath(path)
{
	var TempPath = path;
	
	document.all.Path.innerHTML = '<input type="text" name="iPath" id="iPath" size="28" onKeyDown="if (window.event.keyCode==13) onDriveChange(this.value);" value=' + TempPath + '> '
								  + '<input type="button" value="确定" style="height:20" onclick="onDriveChange(iPath.value);">';
	document.all.iPath.focus();
}

//function onPathChange(path)
//{
//}

//-->
</script>
</head>
<body>
<h3><%=langBrowse%></h3>
<P align=center><%=langOnlyMDB%></P>
<%
dim fso, dir, strCurDir, s, script, d
script = Request.ServerVariables("SCRIPT_NAME")
if Request.QueryString("dir").Count = 0 then 
	strCurDir = Server.MapPath("/")
else
	strCurDir = Request.QueryString("dir")
end if
set fso = Server.CreateObject("Scripting.FileSystemObject")
On Error Resume Next

set dir = fso.GetFolder(strCurDir)
if Err then
	Response.Write "<P class=Error align=center>" & langCannotAccessFolder & Err.Description & "</P>"
	strCurDir = Request.QueryString("curdir")
	set dir = fso.GetFolder(strCurDir)
end if
%>
<P align=left>
	<b><%=langDriveSelector%></B><BR>
	<SELECT name=drive id=drive onchange="javascript:onDriveChange(this.options[this.selectedIndex].value);">
<%
set d = fso.GetDrive(fso.GetDriveName(fso.GetAbsolutePathName(strCurDir)))
%>
		<OPTION value="<%=d.Path%>"><%=d.Path%>&nbsp;(<%=GetDriveType(d.DriveType)%>)</OPTION>
		<OPTION value="">---------</OPTION>
<%for each d in fso.Drives%>
		<OPTION value="<%=d.Path%>"><%=d.Path%>&nbsp;(<%=GetDriveType(d.DriveType)%>)</OPTION>
<%next%>
	</SELECT>
</P>
<table align="left" border="0" width="100%">
<TR><td style="border:1px solid navy"><b><%=langCurrentPath%></B><br><div id="Path"><div onClick="EditPath(this.innerHTML);" style="cursor:hand" title="按这里编辑当前路径"><%=strCurDir%></div></div></td></tr>
<%
set d = nothing
if not dir.IsRootFolder then
%>
<tr><td><a href="<%=script%>?dir=<%=Server.URLEncode(dir.ParentFolder.Path)%>&amp;curdir=<%=Server.URLEncode(strCurDir)%>"><img src="images/folder.gif" border="0" WIDTH="16" HEIGHT="16" align="top">&nbsp;[上级目录]</a></td></tr>
<%end if%>

<%for each s in dir.SubFolders%>
<tr><td><a href="<%=script%>?dir=<%=Server.URLEncode(s.Path & "\")%>&amp;curdir=<%=Server.URLEncode(strCurDir)%>"><img src="images/folder.gif" border="0" WIDTH="16" HEIGHT="16" align="top">&nbsp;<%=s.Name%></a></td></tr>
<%next%>

<%for each s in dir.Files%>
	<%if StrComp(Right(s.Name, 3), "mdb", 1) = 0 then%>
		<tr><td><a href="javascript:pickFile('<%=Replace(s.Path, "\", "\\")%>');"><img src="images/msaccess.gif" border="0" WIDTH="16" HEIGHT="16" align="top">&nbsp;<%=s.Name%></a></td></tr>
	<%end if%>
<%next%>
</table>

<%
set dir = nothing
set fso = nothing
%>
</body>
</html>
<SCRIPT LANGUAGE=vbscript RUNAT=Server>
Function GetDriveType(dtype)
	Select Case dtype
		Case 1: GetDriveType = langRemovable
		Case 2: GetDriveType = langFixed
		Case 3: GetDriveType = langNetwork
		Case 4: GetDriveType = "CD-ROM"
		Case 5: GetDriveType = "RAM-Disk"
		Case Else:	GetDriveType = langUnknown
	End Select
End Function
</SCRIPT>

⌨️ 快捷键说明

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