我正在尝试这段代码:
<a href="file:///C:\Programs\sort.mw">Link 1</a>
<a href="file:///C:\Videos\lecture.mp4">Link 2</a>
但它在 Google Chrome 或 Firefox 浏览器中不起作用。
最佳答案
如果您打开浏览器的控制台,您会看到如下错误:
Not allowed to load local resource:
这是故意的。出于安全原因,Chrome 会阻止以这种方式访问本地文件。当然有办法get around it
关于html - 使用 Asp.net 单击 HTML 页面上的某些链接时如何打开 Windows 文件夹,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46191228/