我使用 asp.net 和这段代码用 IE 打开本地文件:
<script type="text/javascript" language="javascript">
function RunFile() {
WshShell = new ActiveXObject("WScript.Shell");
WshShell.Run("d:/11.doc", 1, false);
}
</script>
<input type="button" value="Run File" onclick="RunFile();"/>
结果还可以:-)
但我想将地址本地文件发送到脚本然后运行这个文件:
例子:
<script type="text/javascript" language="javascript">
function RunFile() {
WshShell = new ActiveXObject("WScript.Shell");
WshShell.Run(**AddressFile**, 1, false);
}
</script>
protected void Page_Load(object sender, EventArgs e)
{
**AddressFile** = "d:/11.doc";
}