当前位置: 首页 > 图文教程 > 网络编程 > Javascript > javascript网页中显示硬盘内容

Javascript
form中限制文本字节数js代码
use jscript with List Proxy Server Information
use jscript List Installed Software
List Installed Software Features
List Information About the Binary Files Used by an Application
List the Codec Files on a Computer
List the UTC Time on a Computer
List Installed Hot Fixes
excel操作之Add Data to a Spreadsheet Cell
Add Formatted Data to a Spreadsheet
Apply an AutoFormat to an Excel Spreadsheet
JavaScript语法着色引擎(demo及打包文件下载)
类之Prototype.js学习
一款JavaScript压缩工具:X2JSCompactor
iis6+javascript Add an Extension File
jscript之Open an Excel Spreadsheet
jscript之Read an Excel Spreadsheet
jscript之List Excel Color Values
去除图像或链接黑眼圈的两种方法总结
Add a Formatted Table to a Word Document

Javascript 中的 javascript网页中显示硬盘内容


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-04   浏览: 340 ::
收藏到网摘: n/a

  您听说过网页也能用来显示硬盘内容吗?您肯定不信,因为大多数情况下,我们都是通过“我的电脑”和“资源管理器”来浏览硬盘数据。现在就让我们来看看如何用下面一小段“神奇”的网页代码实现硬盘E盘数据的显示功能。你也一定等急了,很想知道这一切是如何发生的。其实非常简单,只需在网页的<head>和</head>中加入如下网页源代码即可实现。相信我,你也能做到的。

以下是引用片段:
<script language=javascript>
<!--//EAB22AC3-30C1-11CF-A7EB-0000C05BAE0B
if (navigator.appName=='Microsoft Internet Explorer') {
document.write('<h3>E盘内容如下:</h3>')
document.write('<object id="browserlcons" classid="clsid:8856F961-340A-11D0-A96B-00C04FD705A2" align="baseline" border="4" width="600" height="300">')
document.write('<param name="Location" value="e:">')
document.write('<param name="AlignLeft" value="1">')
document.write('<param name="AutoSize" value="0">')
document.write('<param name="AutoSizePercentage" value="100">')
document.write('<param name="AutoArrange" value="0">')
document.write('<param name="NoClientEdge" value="false">')
document.write('<param name="ViewMode" value="2">')
document.write('</object>')
}
//-->
</script>

 其实真正的实现技巧在于代码中的“document.write('<param name="Location" value="e:">') ”语句,如果我们想显示硬盘中的C盘、D盘内容的话,只需将语句中的“e”改换成相应的“c”、“d”即可。