经典 ASP 在服务器上打开目录
我想通过链接打开位于服务器上的目录。 我的问题是它在 .htm 页面中完美运行,但在 .asp 页面中运行不正常。 这是我使用的:
<a href="file://server/folder/folder/folder" target="_blank">Foldername</a>
我尝试在文件后使用 3 或 5 个斜杠:但结果相同。 我发现没有结果的另一件事是:
<a href="file://server/folder/folder" onclick="window.open(this.href, 'popupwindow', 'width=400,height=300,scrollbars,resizable'); return false;">Link</a>
在尝试在 html 中弄清楚之后,我在 asp 中尝试了以下操作:
<%
str_url="file://server/folder/folder"
Response.Write("<script>")
Response.Write("window.open('" & str_url & "', 'myWin','height=800,width=1024,status=yes,toolbar=yes,menubar=yes,location=yes,resizable=yes,scrollbars=yes');")
Response.Write("</script>")
%>
但在多次尝试让东西正常工作后,我仍然把头撞在墙上。这可能是 IIS7 中禁用的功能吗?或者我错过了什么?
提前致谢
I want to open a directory, that sits on a server, through a link.
My problem is that it works perfectly in an .htm page but not in an .asp page.
Here is what i use:
<a href="file://server/folder/folder/folder" target="_blank">Foldername</a>
I have tried using 3 or 5 slashes after the file: but the same result.
A different thing i found without result is:
<a href="file://server/folder/folder" onclick="window.open(this.href, 'popupwindow', 'width=400,height=300,scrollbars,resizable'); return false;">Link</a>
After trying to figure it out in html i tried the following in asp:
<%
str_url="file://server/folder/folder"
Response.Write("<script>")
Response.Write("window.open('" & str_url & "', 'myWin','height=800,width=1024,status=yes,toolbar=yes,menubar=yes,location=yes,resizable=yes,scrollbars=yes');")
Response.Write("</script>")
%>
But after several attempts to get stuff working i'm still banging my head against the wall. Could this perhaps be a disabled function in IIS7? Or am i missing something?
Thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
file:// 样式链接仅适用于您的本地计算机,您无法使用该方法打开远程服务器上的文件夹。 (除非可以从本地计算机、服务器共享等访问该路径)
The file:// style links will only work for you on your local machine, you cannot open a folder on a remote server using that method. (well not unless that path is accessable from your local machine, a server share or somesuch)
显示目录的一些示例代码:
Some sample code to display a directory: