javaʵÏÖ¶Ô´¿ÕæIPÊý¾Ý¿âµÄ²éѯ
À´Ô´£ºhttp://www.blogjava.net/lcs868/archive/2008/12/16/246644.html
ÓÃjavaʵÏÖ¶Ô´¿ÕæIPÊý¾Ý¿âµÄ²éѯ£¬Ê×Ïȵ½ÍøÉÏÏÂÔØQQwry.daÎļþ£¬¶ÁÈ¡´úÂëÈçÏ£º 1.IP¼Ç¼ʵÌåÀà package com.guess.tools; /** *
* Ò»ÌõIP·¶Î§¼Ç¼£¬²»½ö°üÀ¨¹ú¼ÒºÍÇøÓò£¬Ò²°üÀ¨ÆðʼIPºÍ½áÊøIP * *
* @author swallow */
public class IPEntry {
public String beginIp;
public String endIp;
public String country;
public String area; /** *//**
* ¹¹Ô캯Êý
*/ public IPEntry() {
beginIp = endIp = country = area = "";
} public String toString(){
return this.area+" "+this.country+"IP·¶Î§:"+this.beginIp+"-"+this.endIp;
}
}
2.¶ÁÈ¡QQwry.datÎļþÀà
package com.guess.tools; import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.RandomAccessFile;
import java.nio.ByteOrder;
import java.nio.MappedByteBuffer;
import java.nio.channels.FileChannel;
import java.util.ArrayList;
import java.util.Hashtable;
import java.util.List; /** *//**
* * ÓÃÀ´¶ÁÈ¡QQwry.datÎļþ£¬ÒÔ¸ù¾Ýip»ñµÃºÃÓÑλÖã¬QQwry.datµÄ¸ñʽÊÇ
* Ò». ÎļþÍ·£¬¹²8×Ö½Ú
* 1. µÚÒ»¸öÆðʼIPµÄ¾ø¶ÔÆ«ÒÆ£¬ 4×Ö½Ú
* 2. ×îºóÒ»¸öÆðʼIPµÄ¾ø¶ÔÆ«ÒÆ£¬ 4×Ö½Ú
* ¶þ. "½áÊøµØÖ·/¹ú¼Ò/ÇøÓò"¼Ç¼Çø
* ËÄ×Ö½ÚipµØÖ·ºó¸úµÄÿһÌõ¼Ç¼·Ö³ÉÁ½¸ö²¿·Ö
* 1. ¹ú¼Ò¼Ç¼
* 2. µØÇø¼Ç¼
* µ«ÊǵØÇø¼Ç¼ÊDz»Ò»¶¨Óеġ£¶øÇÒ¹ú¼Ò¼Ç¼ºÍµØÇø¼Ç¼¶¼ÓÐÁ½ÖÖÐÎʽ
* 1. ÒÔ0½áÊøµÄ×Ö·û´®
* 2. 4¸ö×Ö½Ú£¬Ò»¸ö×Ö½Ú¿ÉÄÜΪ0x1»ò0x2
* a. Ϊ0x1ʱ£¬±íʾÔÚ¾ø¶ÔÆ«Òƺ󻹸ú×ÅÒ»¸öÇøÓòµÄ¼Ç¼£¬×¢ÒâÊǾø¶ÔÆ«ÒÆÖ®ºó£¬¶ø²»ÊÇÕâËĸö×Ö½ÚÖ®ºó
* b. Ϊ0x2ʱ£¬±íʾÔÚ¾ø¶ÔÆ«ÒƺóûÓÐÇøÓò¼Ç¼
* ²»¹ÜΪ0x1»¹ÊÇ0x2£¬ºóÈý¸ö×Ö½Ú¶¼ÊÇʵ¼Ê¹ú¼ÒÃûµÄÎļþÄÚ¾ø¶ÔÆ«ÒÆ
* Èç¹ûÊǵØÇø¼Ç¼£¬0x1ºÍ0x2µÄº¬Òå²»Ã÷£¬µ«ÊÇÈç¹û³öÏÖÕâÁ½¸ö×Ö½Ú£¬Ò²¿Ï¶¨ÊǸú×Å3¸ö×Ö½ÚÆ«ÒÆ£¬Èç¹û²»ÊÇ
* ÔòΪ0½áβ×Ö·û´®
* Èý. "ÆðʼµØÖ·/½áÊøµØÖ·Æ«ÒÆ"¼Ç¼Çø
* 1. ÿÌ
Ïà¹ØÎĵµ£º
¹Ø¼ü×Ö: javaÅÅÐòËã·¨
Java¸÷ÖÖÅÅÐòËã·¨
1£©·ÖÀࣺ
1£©²åÈëÅÅÐò£¨Ö±½Ó²åÈëÅÅÐò¡¢Ï£¶ûÅÅÐò£©
2£©½»»»ÅÅÐò£¨Ã°ÅÝÅÅÐò¡¢¿ìËÙÅÅÐò£©
3£©Ñ¡ÔñÅÅÐò£¨Ö±½ÓÑ¡ÔñÅÅÐò¡¢¶ÑÅÅÐò£©
4£©¹é²¢ÅÅÐò
5£©·ÖÅäÅÅÐò£¨ÏäÅÅÐò¡¢»ùÊýÅÅÐò£©
ËùÐ踨Öú¿Õ¼ä×î¶à£º¹é²¢ÅÅÐò
ËùÐ踨Öú¿Õ¼ä×îÉÙ£º¶ÑÅÅÐò
ƽ¾ùËÙ¶È×î¿ì£º¿ìËÙÅÅÐò ......
°²×°Ñ¡ÔñGBK£¬Ê¹ÓÃÑ¡ÔñUTF-8¡£
½â¾ö·½·¨Ò»:(×îÖØÒªµÄÒ»ÖÖ·½·¨)
´ò¿ªmysqlĿ¼ÏµÄbinÎļþ¼Ð£¬ÕÒµ½my.ini£¬Ê¹ÓüÇʱ¾ÕÒ¿ª£¬·Ö±ðÕÒ“[mysql]¡¢[client]¡¢[mysqld]”£¬Ìí¼Ó£¨»ò¸Ä³É£©“default-character ......
תÖÁ£ºhttp://sllereak.blog.163.com/blog
--Òì³£
*Òì³£ÊÇjavaÌṩµÄ´¦Àí³ÌÐòÖÐÔËÐÐʱ´íÎóµÄÒ»ÖÖ»úÖÆ
*java³ÌÐòÔÚÖ´Ðйý³ÌÖÐÈç¹û³öÏÖÒì³££¬»áÉú³ÉÒ»¸öÒì³£ÀàʵÀý£¬¸ÃʵÀý·â×°ÁËÒì³£µÄÐÅÏ¢½»¸øjavaÔËÐÐʱϵͳ£¬ÕâÒ»¹ý³Ì½ÐÅ׳öÒì³£
*µ±Òì³£Å׳öʱÈç¹ûûÓⶻñÄÇôjavaÔËÐÐʱĬÈϵĴ¦Àí·½Ê½Êǽ«Òì ......
public static void main(String[] args)
{
InputStream is = CommonUtil.getStream("http://wz.csdn.net/");
String regex = "(?<=href=\")[^\"]*";//²éÕÒÍøÒ³ÖÐËù ......
JAVAÊÇÒ»ÖÖƽ̨£¬Ò²ÊÇÒ»ÖÖ³ÌÐòÉè¼ÆÓïÑÔ£¬ÈçºÎѧºÃ³ÌÐòÉè¼Æ²»½ö½öÊÊÓÃÓÚJAVA£¬¶ÔC++µÈÆäËû³ÌÐòÉè¼ÆÓïÑÔÒ²Ò»Ñù¹ÜÓá£Óбà³Ì¸ßÊÖÈÏΪ£¬JAVAÒ²ºÃCÒ²ºÃûʲô·Ö±ð£¬ÄÃÀ´¾ÍÓá£ÎªÊ²Ã´ËûÃÇÄÜ´ïµ½Èç´Ë¾³½ç£¿ÎÒÏëÊÇÒòΪ±à³ÌÓïÑÔÖ®¼äÓй²Í¨Ö®´¦£¬Áì»áÁ˱à³ÌµÄ¾«Ë裬×ÔÈ»Äܹ»×öµ½Ò»Í¨°Ùͨ¡£ÈçºÎѧϰ³ÌÐòÉè¼ÆÀíËùµ±È»Ò²ÓÐÐí¶à¹²Í¨µÄµØ·½ ......