81,094
社区成员
发帖
与我相关
我的任务
分享
public static String getCode(byte[] bs) {
ImageIcon icon = new ImageIcon(bs, "hello");
Object ob = JOptionPane.showInputDialog((Component) null, "", "输入验证码",
JOptionPane.INFORMATION_MESSAGE, icon, null, "");
return (String) ob;
}
public static void File() throws Exception {
File file = new File("F:\\psp\\picture\\she\\hebe.jpg");
FileInputStream out = new FileInputStream(file);
byte[] bs = new byte[out.available()];
out.read(bs);
System.out.println(getCode(bs));
}