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.");
}
}
Ïà¹ØÎĵµ£º
ÔÚ¾¹ýÒ»¶Îʱ¼äµÄÐÝÏ¢Ö®ºó£¬Dennis Sosnoski ÓÖ»ØÀ´ÍƳöÁËËûµÄ
Java ±à³ÌµÄ¶¯Ì¬ÐÔ
ϵ
ÁÐµÄµÚ 5 ²¿·Ö¡£ÄúÒÑÔÚÇ°ÃæµÄÎÄÕÂÖп´µ½ÁËÈçºÎ±àдÓÃÓÚת»» Java ÀàÎļþÒԸıä´úÂëÐÐΪµÄ³ÌÐò¡£ÔÚ±¾ÆÚÖУ¬Dennis½«Õ¹Ê¾ÈçºÎʹÓÃ
Javassist
¿ò¼Ü£¬°Ñת»»Óëʵ¼ÊµÄÀà¼ÓÔØ¹ý³Ì½áºÏÆðÀ´£¬ÓÃÒÔ½øÐÐÁé»îµÄ“¼´Ê±”ÃæÏò·½Ã ......
1¡¢http://java.sun.com/
(Ó¢ÎÄ)
SunµÄJavaÍøÕ¾£¬ÊÇÒ»¸öÓ¦¸Ã¾³£È¥¿´µÄµØ·½¡£²»Óöà˵¡£
2¡¢http://www-900.ibm.com/developerWorks/cn/
IBMµÄdeveloperWorksÍøÕ¾£¬Ó¢ÓïºÃµÄÖ±½ÓÈ¥Ó¢ÎÄÖ÷Õ¾µã¿´¡£ÕâÀï²»µ«ÊÇÒ»¸ö¼«ºÃµÄÃæÏò¶ÔÏóµÄ·ÖÎöÉè¼ÆÍøÕ¾£¬Ò²ÊÇWebServices£¬Java£¬Linux¼«ºÃµÄÍøÕ¾¡£Ç¿ÁÒÍÆ¼ö£¡£¡£¡
3¡¢http://www.j ......
´ÓJAVAÖ±½Ó¶ÁÈ¡EXCEL¡¢WORD²¢Éú³ÉPDFÎļþ
1¡£²Ù×÷EXCELºÍWORDÎļþ
ʹÓÃJAVA´ÓEXCEL¡¢WORDÎļþÖжÁдÊý¾Ý£¬¿ÉÒÔʹÓÃhttp://jexcelapi.sourceforge.net/
ÌṩµÄJAVA API£Java Excel API£¬ÕâÀïÓÐÆäÖ¸ÄÏhttp://www.andykhan.com/jexcelapi/tutorial.html
£¬¿ÉÓÉ´ËÏÂÔØJARÎļþhttp://www.andykhan.com/jexcelapi/download.h ......
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 ......