当前位置: 代码迷 >> JavaScript >> JavaScript兑现打开硬盘驱动器,超简单!
  详细解决方案

JavaScript兑现打开硬盘驱动器,超简单!

热度:378   发布时间:2013-03-27 11:22:42.0
JavaScript实现打开硬盘驱动器,超简单!!
<SCRIPT LANGUAGE="JavaScript">
<!--
function DriveList()                 
{
var folder=document.Drive.Name.options[document.Drive.Name.selectedIndex].value;     
document.frames['Computer'].location.href = folder; 
}
function FolderChoose()                  
{
var location=document.UserLocation.FolderLocation.value;     
document.frames['Computer'].location.href = location;      
}
//-->
</script>
<FORM NAME="Drive">
<P><font size="2">选择一个盘符: </font>
<SELECT NAME="Name" onChange="DriveList();">
<OPTION VALUE="C:\">C:\ Drive</OPTION>
<OPTION VALUE="D:\">D:\ Drive</OPTION>
<OPTION VALUE="E:\">E:\ Drive</OPTION>
<OPTION VALUE="F:\">F:\ Drive</OPTION>
</SELECT>
</FORM>
<FORM NAME="UserLocation">
<P><font size="2">直接输入路径: </font>
<INPUT TYPE="text" name="FolderLocation" length="25" size="20">
<INPUT TYPE="button" value="打开" onClick="FolderChoose();"></P>
<P><font size="2">示例: C:\Program Files\Internet Explorer</font></P>
</FORM>
<IFRAME NAME="Computer" SRC="about:blank" WIDTH="100%" HEIGHT="60%"></IFRAME>
</CENTER>
  相关解决方案