RT!

解决方案 »

  1.   

    如果要在windows下操作肯定要用到jndi,麻烦
      

  2.   

    我知道在注册表中可以禁用usb
    而dos命令可以修改注册表
    Java又可以调用dos命令
    那么Java就可以禁用usb了
      

  3.   

    这位仁兄,
    Windows根JNDI有啥关系啊?JNDI是连接池阿。你是想说JNI 吗?我晕了~!!
      

  4.   

    JNDI和JNI是两个不同的概念,JNDI也不是连接池
      

  5.   

    应该还是用 Runtime 把。
      

  6.   

    注册表实现,需要重启机器。。
    JNI:我不会C。怎么办?
      

  7.   

    //本人亲自测试,并不需要重启机器。。Runtime.getRuntime().exec(command)
    用这个方法吧//禁用U盘插入,off.reg
    Windows Registry Editor Version 5.00[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR]
    "Type"=dword:00000001
    "Start"=dword:00000004
    "ErrorControl"=dword:00000001
    "ImagePath"=hex(2):73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,44,00,\
    52,00,49,00,56,00,45,00,52,00,53,00,5c,00,55,00,53,00,42,00,53,00,54,00,4f,\
    00,52,00,2e,00,53,00,59,00,53,00,00,00
    "DisplayName"="USB 大容量存储设备"[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR\Security]
    "Security"=hex:01,00,14,80,90,00,00,00,9c,00,00,00,14,00,00,00,30,00,00,00,02,\
    00,1c,00,01,00,00,00,02,80,14,00,ff,01,0f,00,01,01,00,00,00,00,00,01,00,00,\
    00,00,02,00,60,00,04,00,00,00,00,00,14,00,fd,01,02,00,01,01,00,00,00,00,00,\
    05,12,00,00,00,00,00,18,00,ff,01,0f,00,01,02,00,00,00,00,00,05,20,00,00,00,\
    20,02,00,00,00,00,14,00,8d,01,02,00,01,01,00,00,00,00,00,05,0b,00,00,00,00,\
    00,18,00,fd,01,02,00,01,02,00,00,00,00,00,05,20,00,00,00,23,02,00,00,01,01,\
    00,00,00,00,00,05,12,00,00,00,01,01,00,00,00,00,00,05,12,00,00,00//开启U盘插入(还原),on.reg
    Windows Registry Editor Version 5.00[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR]
    "Type"=dword:00000001
    "Start"=dword:00000003
    "ErrorControl"=dword:00000001
    "ImagePath"=hex(2):73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,44,00,\
    52,00,49,00,56,00,45,00,52,00,53,00,5c,00,55,00,53,00,42,00,53,00,54,00,4f,\
    00,52,00,2e,00,53,00,59,00,53,00,00,00
    "DisplayName"="USB 大容量存储设备"[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR\Security]
    "Security"=hex:01,00,14,80,90,00,00,00,9c,00,00,00,14,00,00,00,30,00,00,00,02,\
    00,1c,00,01,00,00,00,02,80,14,00,ff,01,0f,00,01,01,00,00,00,00,00,01,00,00,\
    00,00,02,00,60,00,04,00,00,00,00,00,14,00,fd,01,02,00,01,01,00,00,00,00,00,\
    05,12,00,00,00,00,00,18,00,ff,01,0f,00,01,02,00,00,00,00,00,05,20,00,00,00,\
    20,02,00,00,00,00,14,00,8d,01,02,00,01,01,00,00,00,00,00,05,0b,00,00,00,00,\
    00,18,00,fd,01,02,00,01,02,00,00,00,00,00,05,20,00,00,00,23,02,00,00,01,01,\
    00,00,00,00,00,05,12,00,00,00,01,01,00,00,00,00,00,05,12,00,00,00
      

  8.   

    补充一句:测试环境:Microsoft Windows XP Professional 版本2002 Service Pack 3
      

  9.   

    Excel禁用U盘(限XP)打开Office Excel 将红色部分的内容复制到单元格确认,保存即可。禁用:在单元格输入=U盘("禁用")
    允用:在单元格输入=U盘("允用")
      

  10.   


    JNDI
    不是连接吃
    那是什么啊?