JAVA BOT³ÌÐòÄ£ÄâÈËÀàÓû§Ìîд±íµ¥ ²¢ ·¢ËÍ
·ÂÕæ±íµ¥£ºBOT³ÌÐòÄ£ÄâÈËÀàÓû§Ìîд±íµ¥ ²¢ ·¢ËÍ
ץȡ±íµ¥£º
HTTPSocket http = new HTTPSocket();
SocketFactory.setProxyHost("openproxy.huawei.com");
SocketFactory.setProxyPort(8080);
HTMLPage page = new HTMLPage(http);
page.open("http://passport.csdn.net/UserLogin.aspx", null);
Vector vec = page.getForms();
HTMLForm htmlForm = (HTMLForm)vec.elementAt(0);
System.out.println("=======action=======");
System.out.println(htmlForm.getAction());
System.out.println("=======method=======");
System.out.println(htmlForm.getMethod());
System.out.println("=======name=======");
System.out.println(htmlForm.getName());
System.out.println("=======value=======");
System.out.println(htmlForm.getValue());
System.out.println("=======toString=======");
System.out.println(htmlForm.toString());
¹¹Ôì·ÂÕæ±íµ¥²¢·¢ËÍ(ÿ¸öÍøÒ³±íµ¥ÐèÒªµÄÔªËز»Ò»Ñù£¬ÏÂÃæ¼ÙÈç¸ÃÒ³ÃæÐèÒªÓû§Ãû£¬ÃÜÂëºÍÓÊÏä)
/**
*htmlForm.set() Ϊ¹¹Ôì³ÌÐò×Ô¶¯·¢ËÍWEBÄ£Äâ±íµ¥Ìá½»µÄÊý¾Ý,Èç: username=apple&password=123&email=apple@123.com
*/
htmlForm.set("username","apple");
htmlForm.set("password","123");
htmlForm.set("email","apple@123.com");
page.post(htmlForm);
Ïà¹ØÎĵµ£º
Javaѧϰ´ÓÈëÃŵ½¾«Í¨
Ò»¡¢ JDK (Java Development Kit)
JDKÊÇÕû¸öJavaµÄºËÐÄ£¬°üÀ¨ÁËJavaÔËÐл·¾³£¨Java Runtime Envirnment£©£¬Ò»¶ÑJava¹¤¾ßºÍJava»ù´¡µÄÀà¿â(rt.jar)¡£²»ÂÛʲôJavaÓ¦Ó÷þÎñÆ÷ʵÖʶ¼ÊÇÄÚÖÃÁËij¸ö°æ±¾µÄJDK¡£Òò´ËÕÆÎÕJDKÊÇѧºÃJavaµÄµÚÒ»²½¡£×îÖ÷Á÷µÄJ ......
win7£¨windows7£©ÏÂjava»·¾³±äÁ¿ÅäÖ÷½·¨
windows7ÏÂjava»·¾³±äÁ¿ÅäÖ÷½·¨£º
1.ÓÃÊó±êÓÒ»÷“ÎҵĵçÄÔ”->ÊôÐÔ
Ñ¡Ôñ×ó±ßµ¼º½µÄ“¸ß¼¶ÏµÍ³ÉèÖÔѡÏȻºóÕâ»ØÊìϤÁË°É£¿
¼ÌÐøÑ¡ÔñÓÒϽǵÄ& ......
ÏÂÃæÊÇÓÃjavaʵÏÖµÄÑ¡ÔñÅÅÐò£¬Ã¿´Î´ÓÊý×éÖÐÑ¡È¡×îСµÄÖµ£º
import java.util.Date;
import java.util.Random;
/*
* Ñ¡ÔñÅÅÐò
*/
public class SelectSort {
public static void main(String args[])
{
int len = 40;
Date date = new Date();
Random random = new Random(date.getSeconds());
int ......
ÏÂÃæÊÇʹÓÃjavaʵÏֵĵݹéÄæÐò¶Ô²éÕÒ£¬ËùνµÄÄæÐò¶Ô¾ÍÊÇÔÚÊý×éA[]ÖÐÈç¹û i < j ,²¢ÇÒA[i] > A[j], ÔòÎÒÃÇ˵A[i]ºÍA[j]ÊÇÒ»¶ÔÄæÐò¶Ô¡£Èç¹ûÓÃÆÕͨµÄË㷨ʵÏֵĻ°£¬²éÕÒµÄʱ¼ä¸´ÔӶȣ¬ÊÇO(N*N)£¬Ê¹ÓÃÕâÀïµÄ¶Ó¹æµÄ·½Ê½²éÕҵĻ°£¬Ê±¼ä¸´ÔÓ¶ÈÊÇO(N*lgN)
import java.util.Date;
import java.util.Random;
/*
* ʹÓõݹ ......