Before the exam, the old review is really meaning. I saw that many people wrote the articles of Java, I saw it, so I didn't have heard of the Eclipse installation, try it. To get it, this software is not bad, you can run correctly on my machine, write a HelloWord, (is not skilled in the opposite object, less writing).
Then get the content of the web page through the URL object
Import java.net. *; import java.io. *;
public class GetURLInfo {public static void main (String arg []) throws Exception {URL Aurl = new ( "http://stu.sdai.edu.cn/") URL; BufferedReader in = new BufferedReader (new InputStreamReader (Aurl. OpenStream ()); string infutline; while ((InputLine = in.readLine ())! = null) System.out.println (InputLine); in.close ();}}
Feeling and C # are almost almost. Later, I learned using Socket.
Socket socket = new Socket ( "202.194.85.2", 80); BufferedReader sin = new BufferedReader (new InputStreamReader (System.in)); PrintWriter os = new PrintWriter (socket.getOutputStream ()); BufferedReader is = new BufferedReader (new InputStreamReader (socket.getinputStream ()))); int i = 0; String getLine; while (i <5) {os.println ("get /bbs/postfo.asp?t_id=3073&l_id=39&ction=do http / 1.1") Os.println ("Accept: * / *"); Os.Println ("Referer: http://stu.sdai.edu.cn/bbs/postfo.Assp?t_id=3073&l_id=39&ction=do"); OS .println ("Accept-Language: EN-CN"); Os.Println ("Accept-Encoding: Gzip, Deflate"); Os.println ("User-Agent: Mozilla / 4.0 (Compatible; Msie 6.0; Windows NT 5.0) .NET CLR 1.1.4322) ")") ")"); Os.Println ("Host: stu.sdai.edu.cn"); Os.Println ("Connection: Keep-alive"); Os.println ("cookie: xplinklinkfylogin = CPB; xplinklinkfeiy = userid = 874 & password = bd8080f72d8b220a & username = wobuzhi; aspsessionidqqqqlcy = hdimhdcdmikgelgohojlnpkl / n / n / n ") Os.flush (); system.out.println ("Client:" "" i); System.out.Println ("Server:" is.readline ()); i ;} Os.close (); Is.close (); Socket.close (); but the object is still not known to use. I don't know how I is emptied. In the summer vacation, I have to learn from the foundation. Today is the interest in cultivation, haha.
Interest is the best teacher!