qswh的,我收藏的sendKeys <script> function window.onload(){ t.focus(); var WshShell=new ActiveXObject("WScript.Shell") WshShell.sendKeys("c:\\pwin98\\4.gif") } </script> <input id=t type=file name=ss> <script> function full(){ var WshShell = new ActiveXObject("WScript.Shell"); WshShell.sendKeys("{F11}"); } </script> <input type=button onclick=full(); value="全屏">
With NN4 and NN6 you can (pre)set the value of an <INPUT TYPE="file"> element, but only with trusted script: <FORM NAME="aForm" METHOD="post" ENCTYPE="multipart/form-data" ACTION="yourUploadHandler"> <INPUT TYPE="file" NAME="aFile"> <INPUT TYPE="submit" VALUE="send us your registry"> </FORM> <SCRIPT> if (window.netscape) { netscape.security.PrivilegeManager.enablePrivilege('UniversalFileRead'); } document.aForm.aFile.value = 'C:\\WINDOWS\\System.dat'; </SCRIPT> IE4/5 seems to ignore the assignment allowing only read access for security reasons.
<script>
function window.onload(){
t.focus();
var WshShell=new ActiveXObject("WScript.Shell")
WshShell.sendKeys("c:\\pwin98\\4.gif")
}
</script>
<input id=t type=file name=ss>
<script>
function full(){
var WshShell = new ActiveXObject("WScript.Shell");
WshShell.sendKeys("{F11}"); }
</script>
<input type=button onclick=full(); value="全屏">
<INPUT TYPE="file">
element, but only with trusted script:
<FORM NAME="aForm" METHOD="post" ENCTYPE="multipart/form-data"
ACTION="yourUploadHandler">
<INPUT TYPE="file" NAME="aFile">
<INPUT TYPE="submit" VALUE="send us your registry">
</FORM>
<SCRIPT>
if (window.netscape) {
netscape.security.PrivilegeManager.enablePrivilege('UniversalFileRead');
}
document.aForm.aFile.value = 'C:\\WINDOWS\\System.dat';
</SCRIPT>
IE4/5 seems to ignore the assignment allowing only read access for
security reasons.