java ʵÏֵĶ˿ÚɨÃèÆ÷
import java.net.*;
import java.io.*;
public class PortScanner {
public static void main(String args[]){
String host="localhost";
new PortScanner().scan(host);
}
public void scan(String host){
Socket socket=null;
System.out.println("scanning...");
for(int port=1;port<65535;port++){
try {
//socket=new Socket(host,port);
socket=new Socket();
SocketAddress remoteAddr=new InetSocketAddress(host,port);
socket.connect(remoteAddr,1);//³¬Ê±Ê±¼ä1ms
System.out.println("there is a server on port "+port);
} catch (UnknownHostException e) {
e.printStackTrace();
} catch (IOException e) {
//System.out.println("connot connect to port"+port);
}finally{
if(socket!=null){
try {
socket.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
System.out.println("scan over.");
}
}
Ïà¹ØÎĵµ£º
Apache Byte Code Engineering Library (BCEL)¿ÉÒÔÉîÈë Java
ÀàµÄ×Ö½ÚÂë¡£¿ÉÒÔÓÃËüת»»ÏÖÓеÄÀà±íʾ»òÕß¹¹½¨ÐµÄÀ࣬ÒòΪ BCEL ÔÚµ¥¶ÀµÄ JVM
Ö¸Á±ðÉϽøÐвÙ×÷£¬ËùÒÔ¿ÉÒÔÈÃÄú¶Ô´úÂëÓÐ×îÇ¿´óµÄ¿ØÖÆ¡£²»¹ý£¬ÕâÖÖÄÜÁ¦µÄ´ú¼ÛÊǸ´ÔÓÐÔ¡£ÔÚ±¾ÎÄÖУ¬Java ¹ËÎÊ Dennis Sosnoski
½éÉÜÁË BCEL µÄ»ù±¾ÄÚÈÝ£¬²¢Òýµ¼¶ÁÕßÍê³ÉÒ»¸öʾÀ ......
Java¼¯ÈºÖ®session¹²Ïí½â¾ö·½°¸
À´Ô´£ºhttp://blog.csdn.net/crskyp/archive/2009/11/19/4836685.aspx
Ëæ×Å»¥ÁªÍøµÄÈÕÒæ׳´ó,ÍøÕ¾µÄpvºÍuv³ÉÏßÐÔ»òÕßÖ¸Êý±¶µÄÔö¼Ó.µ¥·þÎñÆ÷µ¥Êý¾Ý¿âÔçÒѾ²»ÄÜÂú×ãʵ¼ÊÐèÇó.±ÈÈçÏñÊ¢´ó,ÌÔ±¦ÕâÑùµÄ´óÐÍÍøÂ繫˾,¸üÊÇÈç´Ë.
¼¯Èº,Ò²¾ÍÊÇÈÃÒ»×é¼ÆËã»ú·þÎñÆ÷Ðͬ¹¤×÷ ......
Java×¢Ê͹淶
¶¨ÒåÕâ¸ö¹æ·¶µÄÄ¿µÄÊÇÈÃÏîÄ¿ÖÐËùÓеÄÎĵµ¶¼¿´ÆðÀ´ÏñÒ»¸öÈËдµÄ£¬Ôö¼Ó¿É¶ÁÐÔ£¬¼õÉÙÏîÄ¿×éÖÐÒòΪ»»È˶ø´øÀ´µÄËðʧ¡££¨ÕâЩ¹æ·¶²¢²»ÊÇÒ»¶¨Òª¾ø¶Ô×ñÊØ£¬µ«ÊÇÒ»¶¨ÒªÈóÌÐòÓÐÁ¼ºÃµÄ¿É¶ÁÐÔ£©¡£
Java µÄÓï·¨Óë C++ ¼°ÎªÏàËÆ£¬ÄÇô£¬ÄãÖªµÀ Java µÄ×¢ÊÍÓм¸ÖÖÂð£¿ÊÇÁ½ÖÖ£¿ ¡¡¡¡
// ×¢ÊÍÒ»ÐС¡¡¡
/* ...... */ ×¢Ê ......
1.¶ÁÈ¡XMLÎļþµÄÀࣺ
public class XMLUtils {
private final String DB_XML_FILE = "/XMLSetting.xml";
public Properties getPropertiesfromXML() {
URL url = XMLUtils.class.getResource(dBXMLFILE);
URI uri;
try {
uri = url.toURI();
InputSource xmlfile = new InputSource(uri.g ......
/**
* ½»»»ÅÅÐò-ðÅÝÅÅÐò£¬ºËÐÄ˼Ïë ÒÔ´óСΪÒÀ¾Ý½»»»
*
* */
public void bubbleSort(double[] a){
//½«Òª½øÐбȽϵÄÊý´óµÄ¾¡Á¿ÍùºóÅÅ£¬Ã¿´ÎÑ»·°Ñ×î´óµÄÅÅÔÚÒªÅÅÐòÊý×éµÄĩλ¡£
boolean hasSwap = true;
for(int i = 1; i < a.length&& hasSwap; i ++){//Ñ»·µÄ´ÎÊý
hasSwap = ......