摘要:
//java 通过url下载图片保存到本地 public static void download(String urlString, int i) throws Exception { // 构造URL URL url = new URL(urlString); // 打开连接 URLConnection con = u... 阅读全文
摘要:
首先先要导入pinyin4j-2.5.0.jar 这个jar包 阅读全文
摘要:
public static String getSixNum() { String str = "0123456789"; StringBuilder sb = new StringBuilder(4); for (int i = 0; i < 6; i++) { char ch = str.charAt(new Random().nextInt(str.length()));... 阅读全文
摘要:
通过判断浏览器的userAgent,用正则来判断是否是ios和Android客户端。代码如下: <script type="text/javascript"> var u = navigator.userAgent; var isAndroid = u.indexOf('Android') > -1 阅读全文
摘要:
Enumeration<String> paraNames=request.getParameterNames(); for(Enumeration<String> e=paraNames;e.hasMoreElements()){ String thisName=e.nextElement()+" 阅读全文
摘要:
function isDate8(sDate) { if (!/^[0-9]{8}$/.test(sDate)) { return false; } var year, month, day; year = sDate.substring(0, 4); month = sDate.... 阅读全文
摘要:
/* 验证手机号 */ function isPhoneNo(phone) { var pattern = /^1[3456789]\d{9}$/; return pattern.test(phone); } 只验证了手机长度和手机首位必须是1开头,第二位必须是3,4,5,6,7,8,9 ,正确返回 阅读全文
摘要:
正确返回true 错误返回false isIdCardNo.js function isIdCardNo(num) { var factorArr = new Array(7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2, 1); var par 阅读全文
摘要:
public static List getImg(String htmlStr) { List list = new ArrayList(); String img = ""; Pattern p_image; Matcher m_image; // String regEx_img = "]*?>"; //图片链... 阅读全文