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

Java ¶ÏµãÐø´«

±¾ÎÄ´Óhttp://www.blogjava.net/breezedancer/archive/2007/07/19/131264.htmlתÔØ
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.RandomAccessFile;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
//¶ÏµãÐø´«
public class Download {
public static void down(String URL, long nPos, String savePathAndFile) {
try {
URL url = new URL(URL);
HttpURLConnection httpConnection = (HttpURLConnection) url
.openConnection();
// ÉèÖÃUser-Agent
httpConnection.setRequestProperty("User-Agent", "NetFox");
// ÉèÖöϵãÐø´«µÄ¿ªÊ¼Î»ÖÃ
httpConnection.setRequestProperty("RANGE", "bytes=" + nPos);
// »ñµÃÊäÈëÁ÷
InputStream input = httpConnection.getInputStream();
RandomAccessFile oSavedFile = new RandomAccessFile(savePathAndFile,
"rw");
// ¶¨Î»ÎļþÖ¸Õëµ½nPosλÖÃ
oSavedFile.seek(nPos);
byte[] b = new byte[1024];
int nRead;
// ´ÓÊäÈëÁ÷ÖжÁÈë×Ö½ÚÁ÷£¬È»ºóдµ½ÎļþÖÐ
while ((nRead = input.read(b, 0, 1024)) > 0) {
(oSavedFile).write(b, 0, nRead);
}
httpConnection.disconnect();
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
public static long getRemoteFileSize(String url) {
long size = 0;
try {
HttpURLConnection conn = (HttpURLConnection) (new URL(url))
.openConnection();
size = conn.getContentLength();
conn.disconnect();
} catch (Exception e) {
e.printStackTrace();
}
return size;
}
public static void main(String[] args) {
String url = "http://www.blogjava.net/bree


Ïà¹ØÎĵµ£º

²»ÓÃMyEclipseÔÚEclipseÏ´Java web¿ª·¢»·¾³

http://wsc830719.javaeye.com/blog/523873
http://topic.csdn.net/u/20100406/01/e8fa95e2-417d-4706-98a0-2288970697f2.html
http://javafoot.blog.hexun.com/3905915_d.html
http://wiki.apache.org/tapestry/HowToSetupEclipseWtp
ÔÚEclipseÏ°²×°Tomcat²å¼þ
http://hi.baidu.com/tianlan133/blog/item/ad4c2699ea ......

¡¶JAVAºËÐļ¼Êõ¡·¹Ûºó¸Ð


JAVAºËÐļ¼Êõ¹Ûºó¸Ð
  ÕâÖÜ´ó¼Ò¶¼»ù±¾ÉÏÂòÁËÒ»±¾¡¶JAVAºËÐļ¼Êõ¡·À´¿´£¬ËäÈ»ÎÒµÄÊéÏÂÖܲÅÄÜÄõ½£¬µ«ÊÇÎÒ»¹ÊÇ·­ÁËϱðÈ˵ģ¬´óÖÂÁ˽âÁËÒ»ÏÂÀïÃæµÄÄÚÈÝ¡£ÒÔϾÍÊÇÎÒ´Ö²ÚµÄÕûÀí¡£
JAVA²¢²»Ö»ÊÇÒ»ÖÖÓïÑÔ£¬¶øÊÇÒ»¸öÍêÕûµÄƽ̨£¬ÓÐÒ»¸öÅÓ´óµÄ¿â£¬ÆäÖаüº¬ºÜ¶à¿ÉÒÔÖØÓõĴúÂëºÍÒ»¸öÌṩÖîÈ簲ȫÐÔ£¬¿ç²Ù×÷ϵͳµÄ¿ÉÒÆ ......

java¿ò¼ÜѧϰÌå»á

      ×î½üÔÚѧϰjavaµÄ¿ò¼Ü£¬¼ÓÉîÁ˶ÔjavaһЩÉè¼ÆģʽµÄÀí½â£¬ÀýÈçÄ£°å·½·¨Ä£Ê½¡¢²ßÂÔģʽ¡¢´úÀíģʽºÍ¶¯Ì¬´úÀíģʽ£¬·¢ÏÖѧϰÀí½âservletºÍjspºóºÜÈÝÒ×¾Íѧ»áÁËstruts£¬Ñ§Ï°jdbcºó±È½ÏÈÝÒ×Àí½âhibernate£¬±¾ÈË»¹Ã»¿ªÊ¼Ñ§Ï°spring¡£
      ¶Ôstruts¿ò¼ÜµÄÀí½â£ºÖ÷ÒªÊ ......

JavaÖÐstartWith·½·¨µÄʹÓã¡


½ñÌì¿´Java´úÂëʱ£¬¿´µ½ÁË×Ö·û´®ÓÐÒ»¸ö·½·¨ÊÇstartsWith(String str)µ±Ê±¾õµÃ¼ûÃûÖ®Ò⣬ºÜ¼òµ¥Âð£¬È»ºó¾Í×Ô¼º¶¯ÊÖ×öÁËÒ»ÏÂ,ûÏëµ½·¢ÏÖÁËÒ»¸östartsWith()·½·¨µÄÖØÔØ,startsWith(String str,int Index),µ±Ê±ÉÏÍøÈ¥²éÁËÒ»ÏÂûÓкó±ßÕâ¸ö·½·¨,ÓÚÊÇ×Ô¼º×öÁËһϲâÊÔ,ÏÖÔÚ¸ø³öÈçÏÂÏêϸ½âÊÍ,startsWith(String str)¾ÍÊǼì²éÐβΠ......

javaÏÂʹÓÃTeeChartÉú³Éͼ±íµÄѧϰ¼Ç¼(תÔØ)

×î½üÒªÓÃjspÔÚÍøÒ³ÉÏÏÔʾͼ±íÇúÏߣ¬Íø²éÀ´²éÈ¥¾ÓȻûÓÐÎÒÏëÒªµÄ¶«Î÷£¬°¦£¡¿ÉÄܹØ×¢Õâ·½ÃæÓ¦ÓõÄÈËÌ«ÉÙÁË°É¡£²»¹ýÓÐÐÒÈÃÎÒÏÂÔØÁËTeeChart for java£¬ÄǸö½Ð¸ßÐËѽ£¬ÕæÏóÊÇÓöµ½ÁËÊ®¼¸Äêû¼ûµÄÀÏÓÑ¡£µ«ÍøÉÏÏà¹ØÖÐÎÄÎĵµ¡¢×ÊÁÏÌ«ÉÙ£¨¶¼ÊÇaspµÄ£©£¬Ã»°ì·¨£¬Ö»ºÃÓÃ×Ô¼º”¶þ°Ñµ¶“µÄÓ¢Óïˮƽ·­Òë¿Ø¼þ°üÖÐ×Ô´øµÄ×ÊÁÏ£¬¸ãÁ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ