当前位置:首页 » 操作系统 » 聊天软件源码

聊天软件源码

发布时间: 2022-01-08 04:44:33

A. vb 制作一个聊天工具(附源码哦!)

已发送
1。解压后如果控件缺少先点Install.bat
2。大家多提意见,还在搞
3。本人非计算机专业,内行的多提点意见给我
4。本软件完成后将开放所有源码。
5。尚有bug,不会打洞,在internet上目前还不能正常使用,除非服务器在公网上。
6.发送视频时,预览视频,并把摄像头分辩率调成160*120.
sgirl.exe 里下面的一个图像是直接取摄像头的图像
7.本软件有照像和录像功能,可以把摄像头的图像直接保存成jpg的格式。
8。支持语音通迅,支持视频通迅。
9.sgirl.exe是服务器,支持多客户端聊天。可以公聊,私聊,群聊。
10。smile.exe是客户端,右边好友里,选中是私聊,不选中是公聊。
来源http://www.vbgood.com/thread-93539-1-1.html
发件人是[email protected]

B. 那里有即时通信软件的源代码

我有 局域网的聊天 源码 把它改改就可以外网聊天了

C. 谁知道简单的聊天程序源代码(Android的)

代码如下:

package com.neusoft.e.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;
/**
* 服务器端代码
* 获取客户端发送的信息,显示并且返回对应的回复
* 1、创建ServerSocket对象
* 2、调用accept方法获取客户端连接
* 3、使用输入流读取客户端发送的数据
* 4、使用输出流向客户端写入数据
* 5、关闭对应的对象
* @author L
*
*/
public class ChatServer {
/**
* @param args
*/
public static void main(String[] args) {
try {
//1、创建ServerSocket对象,8875为自定义端口号
ServerSocket server = new ServerSocket(8857);

//简单提示
System.out.println("等待客户端连接……");

//2、获取客户端连接
Socket client = server.accept();

//获取客户端的相关信息
System.out.println(client.getInetAddress().getHostAddress() + "连接上来了……");

//3.1、定义输入流和输出流对象
BufferedReader in = new BufferedReader(
new InputStreamReader(
client.getInputStream()));

//用来获取从控制台输入的数据,将该数据发送给客户端
BufferedReader inByServer = new BufferedReader(
new InputStreamReader(System.in));

PrintWriter out = new PrintWriter(client.getOutputStream(), true);

//读取到的数据
String data = null;
String answer = null;

//循环和客户端进行通信
do
{
//3.2、读取客户端发送的数据
data = in.readLine();

//在服务器端显示读取到的数据
System.out.println("客户端发送信息:" + data);

//获取服务器端要发送给客户端的信息
System.out.print("服务器端回复客户端:");
answer = inByServer.readLine();

//3.3、将数据写入到客户端
out.println(answer);
out.flush();
}while(!"bye".equals(data));

//4、关闭相关资源
out.flush();
in.close();
inByServer.close();
out.close();

//关闭Socket对象
client.close();
server.close();

System.out.println("服务器端关闭……");
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}

D. 聊天视频软件源代码

java语言的简单聊天源代码:
Client.java:

import java.io.*;
import java.net.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public class Client extends JFrame {
private JTextField enterField;
private JTextArea displayArea;
private ObjectOutputStream output;
private ObjectInputStream input;
private String message = "";
private String chatServer;
private Socket client;

// initialize chatServer and set up GUI
public Client( String host )
{
super( "Client" );

// set server to which this client connects
chatServer = host;

Container container = getContentPane();

// create enterField and register listener
enterField = new JTextField();
enterField.setEnabled( false );

enterField.addActionListener(

new ActionListener() {

// send message to server
public void actionPerformed( ActionEvent event )
{
sendData( event.getActionCommand() );

}

} // end anonymous inner class

); // end call to addActionListener

container.add( enterField, BorderLayout.NORTH );

// create displayArea
displayArea = new JTextArea();
container.add( new JScrollPane( displayArea ),
BorderLayout.CENTER );

setSize( 300, 150 );
setVisible( true );
}

// connect to server and process messages from server
public void runClient()
{
// connect to server, get streams, process connection
try {

// Step 1: Create a Socket to make connection
connectToServer();

// Step 2: Get the input and output streams
getStreams();

// Step 3: Process connection
processConnection();

// Step 4: Close connection
closeConnection();
}

// server closed connection
catch ( EOFException eofException ) {
System.out.println( "Server terminated connection" );
}

// process problems communicating with server
catch ( IOException ioException ) {
ioException.printStackTrace();
}
}

// get streams to send and receive data
private void getStreams() throws IOException
{
// set up output stream for objects
output = new ObjectOutputStream(
client.getOutputStream() );

// flush output buffer to send header information
output.flush();

// set up input stream for objects
input = new ObjectInputStream(
client.getInputStream() );

displayArea.append( "\nGot I/O streams\n" );
}

// connect to server
private void connectToServer() throws IOException
{
displayArea.setText( "Attempting connection\n" );

// create Socket to make connection to server
client = new Socket(
InetAddress.getByName( chatServer ), 5000 );

// display connection information
displayArea.append( "Connected to: " +
client.getInetAddress().getHostName() );
}

// process connection with server
private void processConnection() throws IOException
{
// enable enterField so client user can send messages
enterField.setEnabled( true );

// process messages sent from server
do {

// read message and display it
try {
message = ( String ) input.readObject();
displayArea.append( "\n" + message );
displayArea.setCaretPosition(
displayArea.getText().length() );
}

// catch problems reading from server
catch ( ClassNotFoundException classNotFoundException ) {
displayArea.append( "\nUnknown object type received" );
}

} while ( !message.equals( "SERVER>>> TERMINATE" ) );

} // end method process connection

// close streams and socket
private void closeConnection() throws IOException
{
displayArea.append( "\nClosing connection" );
output.close();
input.close();
client.close();
}

// send message to server
private void sendData( String message )
{
// send object to server
try {
output.writeObject( "CLIENT>>> " + message );
output.flush();
displayArea.append( "\nCLIENT>>>" + message );
}

// process problems sending object
catch ( IOException ioException ) {
displayArea.append( "\nError writing object" );
}
}

// execute application
public static void main( String args[] )
{
Client application;

if ( args.length == 0 )
application = new Client( "127.0.0.1" );
else
application = new Client( args[ 0 ] );

application.setDefaultCloseOperation(
JFrame.EXIT_ON_CLOSE );

application.runClient();
}

} // end class Client
************************************************
Server.java:

import java.io.*;
import java.net.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public class Server extends JFrame {
private JTextField enterField;
private JTextArea displayArea;
private ObjectOutputStream output;
private ObjectInputStream input;
private ServerSocket server;
private Socket connection;
private int counter = 1;

// set up GUI
public Server()
{
super( "Server" );

Container container = getContentPane();

// create enterField and register listener
enterField = new JTextField();
enterField.setEnabled( false );

enterField.addActionListener(

new ActionListener() {

// send message to client
public void actionPerformed( ActionEvent event )
{
sendData( event.getActionCommand() );

}

} // end anonymous inner class

); // end call to addActionListener

container.add( enterField, BorderLayout.NORTH );

// create displayArea
displayArea = new JTextArea();
container.add( new JScrollPane( displayArea ),
BorderLayout.CENTER );

setSize( 300, 150 );
setVisible( true );
}

// set up and run server
public void runServer()
{
// set up server to receive connections;
// process connections
try {

// Step 1: Create a ServerSocket.
server = new ServerSocket( 5000, 100 );

while ( true ) {

// Step 2: Wait for a connection.
waitForConnection();

// Step 3: Get input and output streams.
getStreams();

// Step 4: Process connection.
processConnection();

// Step 5: Close connection.
closeConnection();

++counter;
}
}

// process EOFException when client closes connection
catch ( EOFException eofException ) {
System.out.println( "Client terminated connection" );
}

// process problems with I/O
catch ( IOException ioException ) {
ioException.printStackTrace();
}
}

// wait for connection to arrive, then display connection info
private void waitForConnection() throws IOException
{
displayArea.setText( "Waiting for connection\n" );

// allow server to accept a connection
connection = server.accept();

displayArea.append( "Connection " + counter +
" received from: " +
connection.getInetAddress().getHostName() );
}

// get streams to send and receive data
private void getStreams() throws IOException
{
// set up output stream for objects
output = new ObjectOutputStream(
connection.getOutputStream() );

// flush output buffer to send header information
output.flush();

// set up input stream for objects
input = new ObjectInputStream(
connection.getInputStream() );

displayArea.append( "\nGot I/O streams\n" );
}

// process connection with client
private void processConnection() throws IOException
{
// send connection successful message to client
String message = "SERVER>>> Connection successful";
output.writeObject( message );
output.flush();

// enable enterField so server user can send messages
enterField.setEnabled( true );

// process messages sent from client
do {

// read message and display it
try {
message = ( String ) input.readObject();

displayArea.append( "\n" + message );
displayArea.setCaretPosition(
displayArea.getText().length() );
}

// catch problems reading from client
catch ( ClassNotFoundException classNotFoundException ) {
displayArea.append( "\nUnknown object type received" );
}

} while ( !message.equals( "CLIENT>>> TERMINATE" ) );
}

// close streams and socket
private void closeConnection() throws IOException
{
displayArea.append( "\nUser terminated connection" );
enterField.setEnabled( false );
output.close();
input.close();
connection.close();
}

// send message to client
private void sendData( String message )
{
// send object to client
try {
output.writeObject( "SERVER>>> " + message );
output.flush();
displayArea.append( "\nSERVER>>>" + message );
}

// process problems sending object
catch ( IOException ioException ) {
displayArea.append( "\nError writing object" );
}
}

// execute application
public static void main( String args[] )
{
Server application = new Server();

application.setDefaultCloseOperation(
JFrame.EXIT_ON_CLOSE );

application.runServer();
}

} // end class Server

***********************************
先在服务器端开启Server.java,再打开客户端的Client.java.就可以聊天了

如果全部运行在本机也可以。

运行试试看吧!

祝你玩的开心。

E. 聊天软件 源码如何使用 高分悬赏

QQ512300098

F. 求Java聊天程序源代码

ChatServer.java
import java.io.*;
import java.awt.*;
import java.awt.event.*;
import java.net.*;
public class ChatServer extends Frame implements ActionListener{
Label label1=new Label("聊天");
Panel panel=new Panel();
TextField tf=new TextField(10);
TextArea ta=new TextArea();
ServerSocket server;
Socket client;
InputStream in;
OutputStream out;
public ChatServer(){
super("服务器");
setSize(250,250); panel.add(label1); panel.add(tf);
tf.addActionListener(this); add("North",panel); add("Center",ta);
addWindowListener(new WindowAdapter(){
public void windowClosing(WindowEvent e){
System.exit(0);}});
show();
try{ server=new ServerSocket(5000);
client=server.accept();
ta.append("已连接的客户机:"+
client.getInetAddress().getHostAddress()+"\n\n");
in=client.getInputStream();
out=client.getOutputStream();
}
catch(IOException ioe){}
while(true){
try{ byte[] buf=new byte[256];
in.read(buf);
String str=new String(buf);
ta.append("客户机说:"+str);
ta.append("\n");
}catch(IOException e){}
}
}
public void actionPerformed(ActionEvent e){
try{ String str=tf.getText();
byte[] buf=str.getBytes();
tf.setText(null);
out.write(buf);
ta.append("我说:"+str);
ta.append("\n");
}catch(IOException ioe){}
}
public static void main(String args[]){
new ChatServer();
}
}

ChatClient.java
import java.io.*;
import java.awt.*;
import java.awt.event.*;
import java.net.*;
public class ChatClient extends Frame implements ActionListener{
Label label1=new Label("聊天");
Panel panel=new Panel();
TextField tf=new TextField(10);
TextArea ta=new TextArea();
ServerSocket server;
Socket client;
InputStream in;
OutputStream out;
public ChatClient(){
super("客户机"); setSize(250,250);
panel.add(label1); panel.add(tf);
tf.addActionListener(this);
add("North",panel); add("Center",ta);
addWindowListener(new WindowAdapter(){
public void windowClosing(WindowEvent e){
System.exit(0);}});
show();
try{ client=new Socket(InetAddress.getLocalHost(),5000);
ta.append("已连接的客户机:"+client.getInetAddress().getHostAddress()+"\n\n");
in=client.getInputStream();
out=client.getOutputStream();
}
catch(IOException ioe){}
while(true){
try{
byte[] buf=new byte[256];
in.read(buf);
String str=new String(buf);
ta.append("服务器说:"+str);
ta.append("\n");
}catch(IOException e){}
}
}
public void actionPerformed(ActionEvent e){
try{
String str=tf.getText();
byte[] buf=str.getBytes();
tf.setText(null);
out.write(buf);
ta.append("我说:"+str);
ta.append("\n");
}catch(IOException ioe){}
}
public static void main(String args[]){
new ChatClient();
}
}

G. 谁有C#的开源聊天工具和源码

网上很多的,我帮你搜索了一下:
http://sourceforge.net/search/?type_of_search=soft&words=chat&search=Search&fq%5B%5D=trove%3A271
这是列表

随便在里面下载了一个:
http://sourceforge.net/projects/unreal-im/files/latest

觉得还不错,不过里面有些好像是不开源的,直接是可执行文件,不过你也可以下载后,用Reflector反编译就得到代码了

H. 有没有当前最好用开源的聊天室源码

实在是抱歉的,当天来说真的是没有最好用的开源的聊天室源码

I. 易语言写聊天软件源码

制作聊天软件,需要有一个聊天服务器支持。除非只是点对点(就是只有双方使用)来发送。
我以前写过网吧的销售程序。功能也类似聊天软件一样,不过也是点对点方式。
P.s:别采纳!

J. 求类似QQ等聊天软件源代码


你觉的有人会在这里给你吗?

热点内容
密码子的原料是什么 发布:2024-09-19 09:11:42 浏览:347
半夜编程 发布:2024-09-19 09:11:36 浏览:103
海康威视存储卡质量如何 发布:2024-09-19 08:55:35 浏览:940
python3默认安装路径 发布:2024-09-19 08:50:22 浏览:516
环卫视频拍摄脚本 发布:2024-09-19 08:35:44 浏览:418
sqlserveronlinux 发布:2024-09-19 08:16:54 浏览:256
编程常数 发布:2024-09-19 08:06:36 浏览:952
甘肃高性能边缘计算服务器云空间 发布:2024-09-19 08:06:26 浏览:162
win7家庭版ftp 发布:2024-09-19 07:59:06 浏览:717
数据库的优化都有哪些方法 发布:2024-09-19 07:44:43 浏览:269