随笔分类 - Java技术积累
深层发掘API
摘要://JNI-命令行窗口输入字符,显掩饰符.txt/*目标:在命令行窗口输入字符,不显所输入字符,显指定的掩饰符作者:tangshancheng@21cn.com*/1、KeyBoard.java源代码//:KeyBoard.javaimportjava.io.*;publicclassKeyBoard{static{System.loadLibrary("inputdll");}publicnativestaticcharget();publicstaticvoidmain(String[]args){ StringBufferstfDir=newStringBuffer(
阅读全文
摘要:用下面的方法可以实现在控制台上输入密码时,密码不显示在控制台上:Console cons=System.console(); System.out.print(" 密码:"); char[] passwd=cons.readPassword(); System.out.println(passwd);说明一下java.io.Console 这个类是 JDK 6 中新增的类库,用于操作系统的控制台,系统的控制台只能在操作系统原生的控制台中使用,不能在 IDE 的控制台中使用,因为 IDE 中的控制台是经过重定向的。Console 这个类增加了一个 readPassword 方
阅读全文
摘要:http://www.blogjava.net/stone2083/archive/2013/06/08/400410.html
阅读全文
摘要:importjava.io.File;importjavax.swing.filechooser.FileSystemView;publicclassByteTest{publicstaticvoidmain(String[]args){FileSystemViewsys=FileSystemView.getFileSystemView();File[]files=File.listRoots();for(inti=0;i<files.length;i++){System.out.println(files[i]+"--"+sys.getSystemTypeDescr
阅读全文

浙公网安备 33010602011771号