com.lgr.zikao.utils; java.text.ParseException; java.text.SimpleDateFormat; java.util.Calendar; java.util.GregorianCalendar; java.util.Hashtable; java.util.Scanner; java.util.regex.Matcher; java.util.regex.Pattern; IdCardValidate { String = ;IDCardValidate(String IDStr) ParseException { String Ai = ; (IDStr.length() != && IDStr.length() != ) { = ; ; } (IDStr.length() == ) { Ai = IDStr.substring(, ); } (IDStr.length() == ) { Ai = IDStr.substring(, ) + + IDStr.substring(, ); } ((Ai) == ) { = ; ; } String strYear = Ai.substring(, );String strMonth = Ai.substring(, );String strDay = Ai.substring(, );((strYear + + strMonth + + strDay) == ) { = ; ; } GregorianCalendar gc = GregorianCalendar(); SimpleDateFormat s = SimpleDateFormat(); { ((gc.get(Calendar.) - Integer.(strYear)) > || (gc.getTime().getTime() - s.parse( strYear + + strMonth + + strDay).getTime()) < ) { = ; ; } } (NumberFormatException e) { e.printStackTrace(); } (java.text.ParseException e) { e.printStackTrace(); } (Integer.(strMonth) > || Integer.(strMonth) == ) { = ; ; } (Integer.(strDay) > || Integer.(strDay) == ) { = ; ; } Hashtable areacode = (); (areacode.get(Ai.substring(, )) == ) { = ; ; } ((Ai,IDStr)==){ = ; ; } ; } isVarifyCode(String Ai,String IDStr) { String[] VarifyCode = { , , , , , , , , ,, }; String[] Wi = { , , , , , , , , , , ,, , , , , }; sum = ; (i = ; i < ; i++) { sum = sum + Integer.(String.(Ai.charAt(i))) * Integer.(Wi[i]); } modValue = sum % ; String strVerifyCode = VarifyCode[modValue]; Ai = Ai + strVerifyCode; (IDStr.length() == ) { (Ai.equals(IDStr) == ) { ; } } ; } Hashtable GetAreaCode() { Hashtable hashtable = Hashtable(); hashtable.put(, ); hashtable.put(, ); hashtable.put(, ); hashtable.put(, ); hashtable.put(, ); hashtable.put(, ); hashtable.put(, ); hashtable.put(, ); hashtable.put(, ); hashtable.put(, ); hashtable.put(, ); hashtable.put(, ); hashtable.put(, ); hashtable.put(, ); hashtable.put(, ); hashtable.put(, ); hashtable.put(, ); hashtable.put(, ); hashtable.put(, ); hashtable.put(, ); hashtable.put(, ); hashtable.put(, ); hashtable.put(, ); hashtable.put(, ); hashtable.put(, ); hashtable.put(, ); hashtable.put(, ); hashtable.put(, ); hashtable.put(, ); hashtable.put(, ); hashtable.put(, ); hashtable.put(, ); hashtable.put(, ); hashtable.put(, ); hashtable.put(, ); hashtable; } isNumeric(String strnum) { Pattern pattern = Pattern.(); Matcher isNum = pattern.matcher(strnum); (isNum.matches()) { ; } { ; } } isDate(String strDate) { Pattern pattern = Pattern .(); Matcher m = pattern.matcher(strDate); (m.matches()) { ; } { ; } } main(String[] args) ParseException { Scanner s=Scanner(System.); System..println(); String IdCard=String(s.next()); IdCard = IdCard.toUpperCase(); System..println((IdCard)); } } 车牌识别停车场管理系统(附SSM项目源代码)视频教程:http://www.kokojia.com/course-6044.html
版权声明:原创作品,允许转载,转载时请务必以超链接形式标明文章原始出处、作者信息和本声明,否则将追究法律责任。https://blog.kokojia.com/software75/b-2593.html