Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

java»ñÈ¡Ò³Ãæ±àÂë

http://babyjoycry.javaeye.com/blog/587527
1. import info.monitorenter.cpdetector.io.CodepageDetectorProxy;
2. import info.monitorenter.cpdetector.io.HTMLCodepageDetector;
3. import info.monitorenter.cpdetector.io.JChardetFacade;
4.
5. import java.io.BufferedReader;
6. import java.io.IOException;
7. import java.io.InputStreamReader;
8. import java.net.HttpURLConnection;
9. import java.net.URL;
10. import java.util.Iterator;
11. import java.util.List;
12. import java.util.Map;
13. import java.util.Set;
14.
15. public class WebEncoding {
16. private static CodepageDetectorProxy detector = CodepageDetectorProxy
17. .getInstance();
18. static {
19.
20. detector.add(new HTMLCodepageDetector(false));
21.
22. detector.add(JChardetFacade.getInstance());
23.
24. }
25. /** ²âÊÔÓÃÀý
26. * @param args
27. */
28. public static void main(String[] args) {
29. WebEncoding web=new WebEncoding();
30. try {
31. System.out.println(web.getCharset("http://www.pujia.com/"));
32. } catch (IOException e) {
33. // TODO Auto-generated catch block
34. e.printStackTrace();
35. }
36. }
37. /**
38. * @param strurl
39. * Ò³ÃæurlµØÖ·,ÐèÒªÒÔ http://¿ªÊ¼£¬Àý£ºhttp: //www.pujia.com
40. * @return
41. * @throws IOException
42. */
43. public String getCharset(String strurl) throws IOException {
44. // ¶¨ÒåURL¶ÔÏó
45. URL url = new URL(strurl);
46. // »ñÈ¡httpÁ¬½Ó¶ÔÏó
47. HttpURLConnection urlConnection = (HttpURLConnection) url
48. .openConnection();
49. ;
50. urlConnection.connect();
51. // ÍøÒ³±àÂ


Ïà¹ØÎĵµ£º

ѧJAVAÐèÒªÕÆÎյļ¼Êõ¼°Á÷³Ì


ѧJAVAÐèÒªÕÆÎյļ¼Êõ¼°Á÷³Ì
¶ÔÓÚjava³õѧÕßÀ´ËµÅÓ´óµÄJavaÓïÑÔ²»Öªµ½´ÓÄÄÀïÈëÊÖ¿ªÊ¼Ñ§Ï°£¬Ò²²»ÖªµÀ¶¼ÒªÑ§Ð©Ê²Ã´²ÅÄÜ·ûºÏÆóÒµµÄÒªÇó£¬ÒÔÏÂÊÇjava˽ÛÓ¸ù¾Ý¼¼ÊõµÄ¸üжøµ÷ÕûµÄ×îнÌѧÄÚÈݼ°Á÷³Ì£¬¹©´ó¼Ò²Î¿¼¡£
1.javaµÄ»ù´¡ÖªÊ¶
²»Òª±»Ð¼¼ÊõÃÔ»ó£¬ËùνÍò±ä²»ÀëÆä×Ú£¬Ð¼¼Êõ¶¼ÊÇ»ùÓÚjavaµÄ»ù´¡Ö®ÉÏ£¬Èç¹û»ù´¡²»Ôúʵ£¬¶Ô ......

javaÖÐStringÓëStringBufferµÄÇø±ð

ÔÚjavaÖÐÓÐ3¸öÀàÀ´¸ºÔð×Ö·ûµÄ²Ù×÷¡£
 
1.Character ÊǽøÐе¥¸ö×Ö·û²Ù×÷µÄ£¬
 
2.String ¶ÔÒ»´®×Ö·û½øÐвÙ×÷¡£²»¿É±äÀà¡£
 
3.StringBuffer Ò²ÊǶÔÒ»´®×Ö·û½øÐвÙ×÷£¬µ«ÊǿɱäÀà¡£
 
String:
ÊǶÔÏó²»ÊÇԭʼÀàÐÍ.
Ϊ²»¿É±ä¶ÔÏó,Ò»µ©±»´´½¨,¾Í²»ÄÜÐÞ¸ÄËüµÄÖµ.
¶ÔÓÚÒѾ­´æÔÚµÄString¶ÔÏóµÄÐÞ¸ ......

java´ò°üexe ÖÆ×÷°²×°°ü With JRE ×ÔÆô¶¯

Ä¿±ê:Óа²×°³ÌÐò°üÏñ°²×°qqÒ»Ñù¼òµ¥Ò»Ö±ÏÂÒ»²½¼´¿É ,¿ÉжÔØ,ÒªÇó³ÌÐò×Ô¶¯Æô¶¯,²»ÐèÒªµ¥¶À°²×°JRE,¾ÍÔÚдÕâÌ×½â¾ö·½°¸µÄʱºò,ÎÒÕæÊÇ°Ù°ãÍ´ºÞ΢Èí.°¥ÎÞÄΰ¡.ÐÒºÃ×îÖÕ»¹ÊDZ»ÎÒÏë³öÀ´ÁË,·ÖÏíÏ°ɡ£
 
µÚÒ»²½
jre¼õ·Ê,ɾ³ýjre\lib\rt.jarÖв»Ê¹ÓõÄÀà,ɾ³ýcharsets.jarÖв»Ê¹ÓõÄ×Ö·û¼¯±àÂë.MyWork¿ªÔ´ÏîÄ¿(http://mywor ......

javaÖеÄClassLoader

ClassLoaderÒ»¸ö¾­³£³öÏÖÓÖÈúܶàÈËÍû¶øÈ´²½µÄ´Ê£¬±¾ÎĽ«ÊÔͼÒÔ×îdzÏÔÒ׶®µÄ·½Ê½À´½²½â ClassLoader£¬Ï£ÍûÄܶԲ»Á˽â¸Ã»úÖƵÄÅóÓÑÆðµ½Ò»µãµã×÷Óᣠ
ÒªÉîÈëÁ˽âClassLoader£¬Ê×ÏȾÍÒªÖªµÀClassLoaderÊÇÓÃÀ´¸ÉʲôµÄ£¬¹ËÃû˼Ò壬Ëü¾ÍÊÇÓÃÀ´¼ÓÔØClassÎļþµ½JVM£¬ÒÔ¹©³ÌÐòʹÓõġ£ÎÒÃÇÖªµÀ£¬java³ÌÐò¿ÉÒÔ¶¯Ì¬¼ÓÔØÀඨÒå£ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ