javaʵÏÖʹÓôúÀí·þÎñÆ÷´´½¨URLÁ¬½Ó
¶ÔÓÚ Java 1.2£¬ÄúÖ»ÐèÓÃ
Authenticator.setDefault() °²×°Ò»¸ö Authenticator¡£ÕâÑù£¬µ±ÐèÒªÈÏ֤ʱ£¬ÒÑ°²×°µÄ Authenticator µÄ
getPasswordAuthentication() ·½·¨¾Í»á±»µ÷Óã¬È»ºóÄú¾Í¿ÉÒÔÓÃÊʵ±µÄÓû§ÃûºÍ¿ÚÁîÀ´ÉèÖà PasswordAuthentication ʵÀý¡£¾ÍÕâô¼òµ¥¡£
package
cn.arthurs.web;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.Authenticator;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.PasswordAuthentication;
import java.net.URL;
import java.util.Properties;
import org.apache.log4j.Logger;
public class WebUnit {
private static final Logger log = Logger.getLogger( WebUnit.class );
/**
* ·µ»ØÒ»¸öÍøÕ¾µÄÔ´´úÂë,ÐèÒª´«ÈëÒ»¸öÍøÕ¾µÄÍøÖ·
* @param webUrl
* @return
*/
public static String getWebContent(String webUrl){
URL url;
HttpURLConnection conn;
InputStream stream;
StringBuffer text = new StringBuffer();
String temp="";
try {
url = new URL(webUrl);
//Èç¹ûÐèÒª´úÀí·þÎñÆ÷
if(false){
Properties prop =
System.getProperties();
// ÉèÖÃhttp·ÃÎÊҪʹÓõĴúÀí·þÎñÆ÷µÄµØÖ·
prop.setProperty("http.proxyHost",
"bmcdc.bmsa.com");
// ÉèÖÃhttp·ÃÎÊҪʹÓõĴúÀí·þÎñÆ÷µÄ¶Ë¿Ú
prop.setProperty("http.proxyPort",
"1865");
// ÉèÖò»ÐèҪͨ¹ý´úÀí·þÎñÆ÷
Ïà¹ØÎĵµ£º
ÔÚÍøÉÏÕÒµÄһЩ×ÊÁÏ~~Ïë´æÆðÀ´~~·½±ãÒÔºó²é¿´
ѧϰJava SwingͼÐλ¯±à³Ì£¬ÎÒÃÇÊ×ÏÈÒªÁ˽âÈý¸ö×î»ù±¾µÄ¸ÅÄ¶¥²ãÈÝÆ÷£¬¿Ø¼þ£¬²¼¾Ö¡£
ÏÂÃæ¾ÍÀ´½éÉÜÒ»ÏÂÕâÈý¸ö»ù±¾¸ÅÄî
1.¶¥²ãÈÝÆ÷
ʲôÊǶ¥²ãÈÝÆ÷£¿µ±ÎÒÃÇʹÓÃJava½øÐÐͼÐαà³ÌµÄʱºò£¬Í¼ÔÚÄÄÀï»æÖÆÄØ£¿ÎÒÃÇÐèÒªÒ»¸öÄܹ»ÌṩͼÐλæÖƵÄÈÝÆ÷£¬ ......
1£®Ç³¸´ÖÆÓëÉÖƸÅÄî
¢Ådz¸´ÖÆ£¨Ç³¿Ë¡£©
±»¸´ÖƶÔÏóµÄËùÓбäÁ¿¶¼º¬ÓÐÓëÔÀ´µÄ¶ÔÏóÏàͬµÄÖµ£¬¶øËùÓеĶÔÆäËû¶ÔÏóµÄÒýÓÃÈÔȻָÏòÔÀ´µÄ¶ÔÏó¡£»»ÑÔÖ®£¬Ç³¸´Öƽö½ö¸´ÖÆËù¿¼ÂǵĶÔÏ󣬶ø²»¸´ÖÆËüËùÒýÓõĶÔÏó¡£
¢ÆÉÖÆ£¨Éî¿Ë¡£©
±»¸´ÖƶÔÏóµÄËùÓбäÁ¿¶¼º¬ÓÐÓëÔÀ´µÄ¶ÔÏóÏàͬµÄÖµ£¬³ýÈ¥ÄÇЩÒýÓÃÆäËû¶ÔÏóµÄ±äÁ¿¡ ......
֮ǰд¹ýÒ»¸öʵÏÖÁËijÖÖ¹¦ÄܵÄjava³ÌÐò£¬µ«ÓÉÓÚ½üÈÕ“¹¤×÷”ÐèÒª£¬ÓÖÐèÒªÔÚc/c++ÖÐÖØÐÂʹÓøù¦ÄÜ¡£ÎªÁ˽Úʡʱ¼ä£¬ÎÒ²ÉÈ¡ÁËÔÚc/c++Öе÷ÓÃjava³ÌÐòµÄ·½·¨£¬µ«Ö®Ç°Ã»ÓнӴ¥¹ýÀàËƵĶ«Î÷£¬µ½ÍøÉÏÒ»²é£¬¹ûÈ»ÓÐÀàËƵĶ«Î÷£¬ÐÄÖаµÏ²ing...¡£²éµ½µÄ×ÊÁÏÖÐÓм¸¸ö²»´íµÄÍøÒ³£º
&nbs ......
×Ô¶¯×°ÏäÓë²ðÏäµÄ¹¦ÄÜÊÂʵÉÏÊDZàÒëÆ÷À´°ïÄúµÄ棬±àÒëÆ÷ÔÚ±àÒëʱÆÚÒÀÄúËù±àдµÄÓï·¨£¬¾ö¶¨ÊÇ·ñ½øÐÐ×°Ïä»ò²ðÏ䶯×÷¡£ÀýÈ磺
Integer i = 100.Ï൱ÓÚ±àÒëÆ÷×Ô¶¯ÎªÄú×÷ÒÔϵÄÓï·¨±àÒ룺
Integer i = new Integer(100).ËùÒÔ×Ô¶¯×°ÏäÓë²ðÏäµÄ¹¦ÄÜÊÇËùνµÄ“±àÒëÆ÷ÃÛÌÇ”(Compiler Sugar)£¬ËäȻʹÓÃÕâ¸ö¹¦Äܷܺ½±ã£¬µ ......
Ctrl+1 ¿ìËÙÐÞ¸´(×î¾µäµÄ¿ì½Ý¼ü,¾Í²»Óöà˵ÁË)
Ctrl+D: ɾ³ýµ±Ç°ÐÐ
Ctrl+Alt+↓ ¸´ÖƵ±Ç°Ðе½ÏÂÒ»ÐÐ(¸´ÖÆÔö¼Ó)
Ctrl+Alt+↑ ¸´ÖƵ±Ç°Ðе½ÉÏÒ»ÐÐ(¸´ÖÆÔö¼Ó)
Alt+↓ µ±Ç°ÐкÍÏÂÃæÒ»Ðн»»¥Î»ÖÃ(ÌرðʵÓÃ,¿ÉÒÔÊ¡È¥ÏȼôÇÐ,ÔÙÕ³ÌùÁË)
Alt+↑ µ±Ç°ÐкÍÉÏÃæÒ»Ðн»»¥Î»ÖÃ(ͬÉÏ)
Alt+← Ç°Ò»¸ö±à¼µ ......