ʹÓÃjava¶ÁÈ¡URL
import java.net.*;
import java.io.*;
public class ReadDemo
{
public static void main(String argv[])
{
try
{
URL url = new URL("http://blog.chinaunix.net/u/15586/showart_1863289.html");
BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
String str;
while((str = in.readLine()) != null)
System.out.println(str);
in.close();
}
catch(MalformedURLException e){}
catch(IOException e) {}
}
}
±¾ÎÄÀ´×Ô: (www.91linux.com) Ïêϸ³ö´¦²Î¿¼£ºhttp://www.91linux.com/html/article/program/java/20090314/16092.html
Ïà¹ØÎĵµ£º
Java AppletÓëJava ApplicationµÄÇø±ð
ÔÚJavaÓïÑÔÖУ¬Äܹ»¶ÀÁ¢ÔËÐеijÌÐò³ÆΪJavaÓ¦ÓóÌÐò£¨Application£©¡£JavaÓïÑÔ»¹ÓÐÁíÍâÒ»ÖÖ³ÌÐò——Applet³ÌÐò¡£Applet³ÌÐò£¨Ò²³ÆJavaС³ÌÐò£©ÊÇÔËÐÐÓÚ¸÷ÖÖÍøÒ³ÎļþÖУ¬ÓÃÓÚÔöÇ¿ÍøÒ³µÄÈË»ú½»»¥¡¢¶¯»ÏÔʾ¡¢ÉùÒô²¥·ÅµÈ¹¦ÄܵijÌÐò¡£
Java Appletº ......
.net´úÂëÈçÏ£¬
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
//ÈôÒªÔÊÐíʹÓà ASP.NET AJAX ´Ó½Å±¾Öе÷ÓÃ´Ë Web ·þÎñ£¬ÇëÈ¡Ïû¶ÔÏÂÐеÄ×¢ÊÍ¡£
// [System.Web.Script.Services.ScriptService]
public class SysService : System.Web.Services.Web ......
Ò»¡¢Ê×ÏÈÀ´¿´Ò»ÏÂhttpµÄ±¨ÎĽṹ
1¡¢ÇëÇó±¨ÎÄ
Ò»¸öHTTPÇëÇó±¨ÎÄÓÉÇëÇóÐУ¨request line£©¡¢ÇëÇóÍ·²¿£¨header£©¡¢¿ÕÐкÍÇëÇóÊý¾Ý4¸ö²¿·Ö×é³É£¬ÏÂͼ¸ø³öÁËÇëÇó±¨ÎĵÄÒ»°ã¸ñʽ¡£
(1)ÇëÇóÐÐ
ÇëÇóÐÐÓÉÇëÇó·½·¨×ֶΡ¢URL×ֶκÍHTTPÐÒé°æ±¾×Ö¶Î3¸ö×Ö¶Î×é³É£¬ËüÃÇÓÿոñ·Ö¸ô¡£ÀýÈ磬GET /index.html HTTP/1.1¡£
HTTPÐÒéµÄÇëÇ ......
Annotations
AnnotationsÊÇJ2SE 5.0ÒýÈëµÄÐÂÓïÑÔÌØÐÔ¡£Í¨³££¬ AnnotationsÔÊÐí¿ª·¢ÕßÓÃÒ»ÖÖ¸úÔËÐдúÂëÎ޹صĴÎÒªÐÅÏ¢À´±ê×¢À࣬·½·¨ÒÔ¼°³ÉÔ±¡£ÕâÑù¾Í¿ÉÒÔʹÓÃÀàËÆÆÀ¼ÛµÄ Annotations£¬±ÈÈ瓺÷½·¨”¡¢“»µ·½·¨”£¬»òÕ߸üÏêϸһЩ£¬“²»ÍƼöµÄ·½·¨”¡¢“¸²Ð´µÄ·½·¨&rdq ......
ת http://jiangzhengjun.javaeye.com/blog/506952
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.Outp ......