java socket¿ÕÒì³££¡
package com.Socket;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.ServerSocket;
import java.net.Socket;
public class Server {
private ServerSocket ss;
private Socket socket;
private BufferedReader in;
private PrintWriter out;
public Server()
{
try
{
ss=new ServerSocket(10000);
while(true)
{
socket = ss.accept();
String RemoteIP = socket.getInetAddress().getHostAddress();
String RemotePort = ":"+socket.getLocalPort();
System.out.println("A client come in!IP:"+RemoteIP+RemotePort);
in = new BufferedReader(new
InputStreamReader(socket.getInputStream()));
String line = in.readLine();
System.out.println("Cleint send is :" + line);
out = new PrintWriter(socket.getOutputStream(),true);
out.println("Your Message Received!");
out.close();
in.close();
socket.close();
}
}catch (IOException e)
{
out.println("wrong");
}
}
public static void main(String[] args)
{
new Server();
}
}
Exception in thread "main" ja
Ïà¹ØÎÊ´ð£º
ÏÖÔÚ»¹ÓкܶàÈ˸㲻¶®PHPºÍJAVA¿ª·¢µÄÐͬOAµ½µ×ÓÐʲô²»Í¬£¬¶Ô×Ô¼ºµ½µ×ÓÐʲôӰÏ죬ÒÔÖÁÓÚ×ö³öÁË´íÎóµÄÑ¡Ôñ¶øêݺ¦ÎÞÇî¡£±ÊÕ߸ù¾ÝÁ½ÖÖ¼¼ÊõµÄÌصãÖØÐÂÕûÀíÁËÒ»¸ö¶Ô±È£¬¸ø¹ØÐÄÐͬOA¼¼ÊõµÄ¶ÁÕß×ö¸ö²Î¿¼¡£
»ªÌ춯Á¦Ð ......
¸÷룬¸ø¿´¿´°É~~~Îҳ̶ȲÇë¶àµãÌáʾ¡£
Çé¿öÊǽ´µÄ£º
ÔÀ´µÄ³ÌÐòÊÇÔÚsql2000Ï¿ª·¢µÄ£¬¸Ã³ÌÐò¾¹ýºÜ¶à²âÊÔ¶øÇÒ¶¼Ó¦ÓÃÔÚsql2000Ï£¬Ã»ÓÐÎÊÌâ¡£¸Ã³ÌÐòÊÇJAVAµÄ¡£
ÏÖÔÚÎÒÓÃÁËsql2005£¬tomcatÆô¶¯Ê±Ã»ÎÊ ......
Ä¿Ç°ÓÐÒ»¸öjava³ÌÐò,µ÷Óô洢¹ý³ÌÔÚÊý¾Ý¿âÖÐдÈëһЩÊý¾Ý£¬È»ºó½«ÕâЩÊý¾Ý´«Êä¸øÁíÍâÒ»¸ö³ÌÐò,Ä¿Ç°²»¹ÜjavaÁ¬½Ó³É¹¦»òÊDz»³É¹¦£¬¸Ã´æ´¢¹ý³Ì¶¼»áдÈëÊý¾Ý!
Ä¿Ç°ÐèÒªÔÚjavaÁ¬½Ó²»³É¹¦µÄÇé¿öÏÂ,Óкη½·¨ÄÜʹ´æ´¢¹ý³Ì ......
¶¨ÒåÒ»¸öÈ˵ÄÀ࣬ÀïÃæÓÐÈ˵ÄÊôÐÔ£¬ÔÙ¶¨ÒåÒ»¸öÆû³µµÄÀ࣬ÔÙ¶¨ÒåÒ»¸ö¿ªÆû³µµÄÀ࣬ÀïÃæÊÇ¿ªÆû³µµÄ·½·¨£¬·½·¨ÀïÃæµ÷ÓÃÈ˵ÄÊôÐÔºÍÆû³µµÄÊôÐÔ£¬°ÑËûÃÇÁ¬½ÓÆðÀ´µÄÕâ¸öÀàÓÃÕý¹æµÄÊéÃæÓïÑÔ½Ðʲô£¬ÆäËûÁ½¸öÀàÓÖ½Ðʲô£¡
......
ÏÖÔÚÓöµ½ÕâÑùÒ»¸öÎÊÌ⣺
ÔÚjava Öбàдswing³ÌÐò£¬ Ìí¼Ó°´Å¥jbServerStart£¬Ä¿µÄÊǵ±µã»÷jbServerStartʱ£¬³ÌÐò»á×Ô¶¯´´½¨Á½¸öÓëÆäËûÖÕ¶ËͨÐŵĶÔÏ󣬴úÂëÈçÏ£º
private Container createButtonPane ......