javascript網頁中顯示硬碟內容

來源:互聯網
上載者:User

   您聽說過網頁也能用來顯示硬碟內容嗎?您肯定不信,因為大多數情況下,我們都是通過“我的電腦”和“資源管理員”來瀏覽硬碟資料。現在就讓我們來看看如何用下面一小段“神奇”的網頁代碼實現硬碟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”即可。

文章出處:http://www.diybl.com/course/1_web/javascript/Javascriptshl/2008922/144481.html

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.