Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

java SSL°²È«socketµÄͨѶʵÀý javaѧϰ±Ê¼Ç(4)

ѧϰÁËSSLµÄ»ù±¾Ô­Àíºó..¶¯ÊÖÓÃjavaÀ´ÊµÏÖÁËÒ»¸ö°²È«Á¬½ÓµÄʵÀý..
1.ʹÓÃkeytool´´½¨ÃÜÔ¿¶Ô..²¢ÔÚ·þÎñ¶ËºÍ¿Í»§¶ËÍê³É·ÖÅä..¾ßÌå·½·¨¿É²Î¿´:java-ʹÓÃkeytoolÀ´´´½¨¹ÜÀíÃÜÔ¿¼°Ö¤ÊéµÈ-javaѧϰ±Ê¼Ç(3)
2.½¨Á¢¿Í»§¶ËºÍ·þÎñ¶ËµÄsocketʵÀý:
¿Í»§¶Ë´úÂëÈçÏÂ:
public class SSLClient {
public static void startSSLClient() throws IOException {
int port = 15408;//ÒªÁ¬½ÓµÄ·þÎñÆ÷¶Ë¿Ú
String serverAdd = "127.0.0.1";//ÒªÁ¬½ÓµÄ·þÎñÆ÷µØÖ·
try {
System.setProperty("javax.net.ssl.trustStore","clientkey.jks");//ÉèÖÿÉÐÅÈεÄÃÜÔ¿²Ö¿â
System.setProperty("javax.net.ssl.trustStorePassword","sslkey1"); //ÉèÖÿÉÐÅÈεÄÃÜÔ¿²Ö¿âµÄÃÜÂë
SSLSocketFactory sslsf = (SSLSocketFactory)SSLSocketFactory.getDefault();//ÀûÓù¤³§À´´´½¨SSLSocket°²È«Ì×½Ó×Ö
Socket csocket = sslsf.createSocket(serverAdd,port);//´´½¨²¢Á¬½Ó·þÎñÆ÷
System.out.println("Client OK~");
System.out.println("===============");
System.out.println("");
//ÒÔÏ´úÂëͬsocketͨѶʵÀýÖеĴúÂë
BufferedReader socketIn = new BufferedReader( new InputStreamReader(csocket.getInputStream()));//½ÓÊܵ½µÄÐÅÏ¢
PrintStream socketOut = new PrintStream(csocket.getOutputStream());//Òª·¢Ë͵ÄÐÅÏ¢
BufferedReader userIn = new BufferedReader( new InputStreamReader(System.in));//Óû§ÊäÈëÐÅÏ¢
String s;
while ( true ) {
System.out.print("Client Message: ");
s = userIn.readLine();
socketOut.println(s);
if ( s.trim().equals("BYE") ) break;
else {
System.out.println("Please wait Server Message..");
System.out.println("");
}
s = socketIn.readLine();
System.out.println("Server Message: " + s);
if ( s.trim().equals("BYE") ) break;
}
socketIn.close();


Ïà¹ØÎĵµ£º

ÓÃJava NIOдHTTP Server¼Ç¼

»¨ÁËÒ»¸ö¶àÔÂÓÃJava NIOдÁËÒ»¸ö¶¨ÖƵÄHTTP Server£¬Ö÷ÒªÊÇÖ§³ÖÎÒµÄWeBuzz.IMÍøÒ³°æÁÄÌì·þÎñ
¡£
ÏȽéÉÜÒ»ÏÂWeBuzz.IMÍøÒ³ÁÄÌì·þÎñ¡£
WeBuzz.IM
ÊÇÒ»¿îÍøÒ³°æ¼´Ê±ÁÄÌ칤¾ß£¬ÓÃÓÚ°ïÖúÓû§Í¨¹ýÍøÒ³ºÍÅóÓÑÁÄÌì¡£Gtalk£¨Google Talk£©
¡¢MSN£¨Windows Live Messenger£©
¡¢Yahoo! Messenger£¨Yahoo! Chat£¬ÓÖ³ÆΪÑÅ»¢Í¨£©
......

ÈçºÎÔÚUltraEditÖÐʹjavaÎļþÓï·¨¸ßÁÁÏÔʾ£¿

ÈçºÎÔÚUltraEditÖÐʹjavaÎļþÓï·¨¸ßÁÁÏÔʾ£¿
 
1.  UltraEdit¹Ù·½ÍøÕ¾ÏÂÔØËùÐèÎļþ¸ñʽµÄÓï·¨·½, http://www.ultraedit.com/downloads/extras.html£¬Ñ¡ÔñjavaÏÂÔØ¡£
2.  Ñ¡Ôñ“¸ß¼¶”->“ÅäÖÔ
3.  Ñ¡Ôñ“±à¼­Æ÷ÏÔʾ”->“Óï·¨¼ÓÁÁ”£¬µã»÷“ ......

javaÖÐʹÓÃdom4jдxmlÎļþºÍ¼òµ¥½Ì³Ì

 
ÏÂÔØ dom4j-1.6.1.jar¡£
1: package org.zzp.common.xml.dom4j;
2:
3: import java.io.FileWriter;
4: import java.io.IOException;
5: import org.dom4j.Document;
6: import org.dom4j.DocumentHelper;
7: import org.dom4j.Element;
8: import org.dom4j.io.OutputFormat;
9: impor ......

JAVA EXCEL API¼ò½é

      Ê¹ÓÃWindows²Ù×÷ϵͳµÄÅóÓѶÔExcel£¨µç×Ó±í¸ñ£©Ò»¶¨²»»áÄ°Éú£¬µ«ÊÇҪʹÓÃJavaÓïÑÔÀ´²Ù×ÝExcelÎļþ²¢²»ÊÇÒ»¼þÈÝÒ×µÄÊ¡£ÔÚWebÓ¦ÓÃÈÕÒæÊ¢ÐеĽñÌ죬ͨ¹ýWebÀ´²Ù×÷ExcelÎļþµÄÐèÇóÔ½À´Ô½Ç¿ÁÒ£¬Ä¿Ç°½ÏΪÁ÷ÐеIJÙ×÷ÊÇÔÚJSP»òServlet Öд´½¨Ò»¸öCSV £¨comma separated values£©Îļþ£¬²¢½«Õ⸠......

ÔÚJava 3DÖÐÔØÈëÍⲿ3DÄ£ÐÍÎļþ

Java 3DËäÈ»ÄÜÖ§³ÖÖÚ¶àµÄÍⲿ3DÄ£ÐÍÎļþ£¬µ«ÄÜÖ§³Ö±»Java 3DʹÓõÄÍⲿģÐÍÎļþ½öΪ.objºÍ.lwdÁ½ÖÖ£»·Ö±ð¶ÔÓ¦ObjectFileÀàºÍLw3dLoaderÀà¡£Ïà±È֮ϼ¸¿îÖ÷Á÷µÄ3D½¨Ä£Èí¼þ¶¼ÄÜÉú³É.obj¸ñʽµÄÎļþ£¬Òò´Ë±¾ÎÄÖ÷Òª½éÉÜʹÓÃObjectFileÀàÔØÈë.objÎļþµÄ·½·¨¡£
ObjectFileÀàÓÐÈý¸ö¹¹Ôì·½·¨£¬·Ö±ðΪ£º
ObjectFile()
ObjectFile( ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ