<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%
dim www:www = "http://127.0.0.1"
dim root:root = "E:\Desktop\test"
dim dir:dir = Request.QueryString("dir")
if dir = "undefined" then dir = root & "\" else dir = dir & "\"
if instr(dir, root) = 1 then
set fso = Server.CreateObject("Scripting.FileSystemObject")
if fso.FolderExists(dir) then
set gf = fso.GetFolder(dir)
dim paths:paths = """paths"":["
For Each path in gf.subfolders
paths = paths & ",""" & path & """"
Next
paths = paths & "]"
paths = replace(paths, "[,", "[")
dim files:files = """files"":["
For Each file in gf.files
files = files & ",""" & file & """"
Next
files = files & "]"
files = replace(files, "[,", "[")
set fg = nothing
set fso = nothing
response.write(replace("{" & paths & "," & files & "}", "\", "\\"))
response.end()
end if
set fso = nothing
end if
%>
<
<html>
<head>
<meta charset="UTF-8">
<title>文件浏览器</title>
<link rel="stylesheet" href="https://cdn.bootcss.com/font-awesome/5.10.2/css/all.min.css">
<link rel="stylesheet" href="https://cdn.bootcss.com/dplayer/1.25.0/DPlayer.min.css">
<style>
* { margin: 0; padding: 0; color: #666; font-family: "microsoft yahei"; }
.header { background-color: #333; line-height: 60px; color: #FFF; font-size: 30px; text-indent: 2%; }
.bar { padding: 0 2%; width: 96%; background-color: #EEE; border-bottom: 1px solid #DDD; overflow: hidden; zoom: 1; }
.bar .up { float: left; line-height: 40px; font-size: 16px; cursor: pointer; }
.bar .dir { float: left; margin-left: 20px; line-height: 40px; font-size: 16px; }
.bar .view { float: right; line-height: 40px; }
.bar .view a { padding-left: 10px; font-size: 16px; text-decoration: none; }
#content { padding: 10px 2%; width: 96%; overflow: hidden; zoom: 1; }
#content dl:hover { background-color: #F6F6F6; }
.v dl { height: 40px; border-bottom: 1px dotted #CCC; cursor: pointer; }
.v dl dt { float: left; margin-left: 10px; width: 40px; line-height: 40px; text-align: center; font-size: 30px; }
.v dl dd { float: left; margin-left: 5px; line-height: 40px; text-align: center; font-size: 16px; }
.h dl { float: left; margin: 0 5px 10px 5px; width: 120px; height: 100px; cursor: pointer; }
.h dl dt { width: 120px; line-height: 60px; text-align: center; font-size: 60px; }
.h dl dd { height: 40px; line-height: 20px; font-size: 14px; text-align: center; overflow: hidden; }
#dplayer { display: none; width: 720px; height: 576px; }
</style>
</head>
<body>
<div class="header">文件浏览器</div>
<div class="bar">
<div class="up"><i class="fa fa-reply" aria-hidden="true"></i> 上级目录</div>
<div class="dir"></div>
<div class="view">
<a href="javascript:$('#content').attr('class', 'v');" class="fa fa-th-list" aria-hidden="true"></a>
<a href="javascript:$('#content').attr('class', 'h');" class="fa fa-th-large" aria-hidden="true"></a>
</div>
</div>
<div class="h" id="content"></div>
<div id="dplayer"></div>
</body>
</html>
<script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>
<script src="https://cdn.bootcss.com/layer/2.3/layer.js"></script>
<script src="https://cdn.bootcss.com/dplayer/1.25.0/DPlayer.min.js"></script>
<script src="https://cdn.bootcss.com/flv.js/1.5.0/flv.min.js"></script>
<script>
const www =
const root =
function getDir(_dir) {
// 路径显示,不显示根目录
var path = _dir == undefined ?
$(
// 获取目录和文件
$.getJSON(
var list =
for (i in json.paths) {
list +=
}
for (i in json.files) {
list +=
}
$(
});
}
$(function() {
getDir();
// 上一级目录
$(
var dir = $(
var dirCell = dir.split(
if (dir
getDir(root + dir.replace(
}
});
$(
var path = $(this).data(
// 进入下一级目录
if (path) {
getDir(path);
}
// 播放flv文件
if (file && file.split(
var videourl = file.replace(root, www).replace(/\\/g,
const dp = new DPlayer({
container: document.getElementById(
contextmenu: [{ text:
video: { url: videourl, type:
});
layer.open({
type: 1,
title: false,
area: [
content: $(
cancel: function(index, layero) { dp.destroy(); }
});
dp.play();
}
});
});
</script>