zoukankan      html  css  js  c++  java
  • 在网页中得到usb设备的id并读取其中的值

     

    <BODY oncontextmenu=self.event.returnValue=false;
    onmousemove="if(event.ctrlKey) document.all.aaaa.focus()"
    onselectstart="return false" leftMargin=0 topMargin=0>
    <SCRIPT language=JavaScript1.2>
    if (document.all)
    document.body.onmousedown=new Function("if(event.button==2||event.button==3)window.external.addFavorite('thank you!')")
    </SCRIPT>
    <script language = "JavaScript">
    function  test()
    {
    var fso,f,r,s,n,e,x,m,l;
    var ForReading = 1,RorWriting = 2;
    fso = new ActiveXObject("Scripting.FileSystemObject");
    e = new Enumerator(fso.Drives)
    s = "";
    for(;!e.atEnd();e.moveNext())
    {

    x = e.item();
    if(x.DriveType == 1)
    {
    if(x.Path != "A:")
    {
    alert("您U盘的序列好为:  "+x.SerialNumber);
    l = "http://localhost/dd/receive.asp?add="+x.SerialNumber;
    m = x.Path;
    f = fso.OpenTextFile(m+"\\1.txt",ForReading);
    r = f.ReadAll();
    l = "http://localhost/dd/receive.asp?add="+ r;
    window.parent.location = l ;
    }
    }
    if(m  == "")
    {
    alert("您的密钥没有准备好!");
    }


    }

    }
    </script>
    <a href="javascript:test();"><h2>CLick me</a></iframe>
    </body>

  • 相关阅读:
    平时十二测
    无题十四
    暑假第十测
    无题十三
    noip错题集
    无题十二
    BZOJ整理
    志愿者招募
    修车
    任务安排
  • 原文地址:https://www.cnblogs.com/ggbbeyou/p/1596883.html
Copyright © 2011-2022 走看看