- 浏览: 48534 次
最新评论
-
haoyun2020:
message是什么类型的数据?
Java实现msn发消息的功能 -
goodluck168:
试试看,能否使用
Java实现msn发消息的功能 -
crabboy:
这贴很少经典,dwr推模式。
能否将代码贴全罗
Dwr反转Ajax -
tedeyang:
是要顶的。
Java实现msn发消息的功能 -
rainytooo:
你们.........
新年快乐
说明:以下是实现代码,关于msn协议的分析请参考http://www.cnpaf.net/Forum/viewthread.php?tid=1761。
这里只考虑了如何实现msn发消息的功能,至于面向对象,线程之类的暂时没考虑那么多,大家就将就一下了。。。
1.主类:
/**
* Author EvilgoD
* QQ:7771465
* blog:http://evilgod.iteye.com
* Date 2008-1-8
*/
public class MyMSN{
public static void main(String []args) throws Exception {
String username="urname@xxx.com";
String password="urpsw";
String remoteusername="urfriend@xxx.com";
String instantmessage="test!";
MSNServer server=new MSNServer(username,password);
server.login();
server.setStatus();
server.send(remoteusername,instantmessage);
server.close();
}
}
2. MSNServer类:
/**
* Author EvilgoD
* QQ:7771465
* blog:http://evilgod.iteye.com
* Date 2008-1-8
*/
import java.io.*;
import java.net.*;
import java.util.*;
import java.security.*;
import javax.net.ssl.*;
public class MSNServer{
public String username,password;
private int command=0;//流水号
private Socket server;
private PrintWriter out;
private MSNFilterStream in;
public String temp;
public MSNServer(String username,String password){
this.username=username;
this.password=password;
}
//登录
public void login() throws Exception{
server = new Socket("messenger.hotmail.com", 1863);
server.setTrafficClass(0x10);
out = new PrintWriter(server.getOutputStream(), true);
in=new MSNFilterStream(new BufferedInputStream(server.getInputStream()));
//报告协议号
message="VER "+command+" MSN10 MSNP9 CVRO ";
out.println(message);
command++;
temp=in.readLine();
System.out.println(temp);
//报告本机消息
message="CVR "+command+" 0x0804 winnt 5.2 i386 MSNMSGR 7.5.0299 MSMSGS "+username+" ";
out.println(message);
command++;
temp=in.readLine();
System.out.println(temp);
//提交登录用户名
message="USR "+command+" TWN I "+username+" ";
out.println(message);
command++;
temp=in.readLine();
System.out.println(temp);
//连接到ns服务器
StringTokenizer st=new StringTokenizer(temp);
st.nextToken();st.nextToken();st.nextToken();
String ns=st.nextToken();//NS地址
out.close();//关闭与DS服务器的连接
in.close();
server.close();
String []split=ns.split(":");
server=new Socket(split[0],Integer.parseInt(split[1]));
server.setTrafficClass(0x10);
out = new PrintWriter(server.getOutputStream(), true);
in=new MSNFilterStream(new BufferedInputStream(server.getInputStream()));
message="VER "+command+" MSN10 MSNP9 CVR0";
command++;
out.println(message);
temp=in.readLine();
System.out.println(temp);
//报告本机信息
message="CVR "+command+" 0x0804 winnt 5.2 i386 MSNMSGR 7.5.0299 MSMSGS "+username+" ";
out.println(message);
command++;
temp=in.readLine();
//发送用户信息
message="USR "+command+" TWN I "+username+" ";
out.println(message);
command++;
//!验证登录信息,首先在HTTPS端口443向nexus.passport.com发送一个GET请求,将账号、密码和NS给定的一长串信息送出
temp=in.readLine();
System.out.println(temp);
st=new StringTokenizer(temp);
st.nextToken();st.nextToken();st.nextToken();st.nextToken();
String args=st.nextToken();
Socket login = new Socket("nexus.passport.com", 443);
login = ((SSLSocketFactory)SSLSocketFactory.getDefault()).createSocket(login, "nexus.passport.com", 443, true);
BufferedReader readin = new BufferedReader(new InputStreamReader(new LogInputStream(login.getInputStream())));
PrintWriter printout = new PrintWriter(login.getOutputStream(), true);
printout.println("GET /rdr/pprdr.asp");
String host = null;
String get = null;
String data = readin.readLine();
while (data != null) {
System.out.println(data);
if (data.startsWith("PassportURLs:")) {
data = data.substring(14);
StringTokenizer tok = new StringTokenizer(data, ",");
while (tok.hasMoreTokens()) {
String tmp = tok.nextToken();
if (tmp.startsWith("DALogin=")) {
tmp = tmp.substring(8);
host = tmp.substring(0, tmp.indexOf("/"));
get = tmp.substring(tmp.indexOf("/"));
}
}
}
data = readin.readLine();
}
boolean redirect = true;
String auth = null;
//根据情况,会重定向到不同的URL;然后,重新向指定的URL发出请求
while (redirect) {
redirect = false;
login = new Socket(host, 443);
login = ((SSLSocketFactory)SSLSocketFactory.getDefault()).createSocket(login, host, 443, true);
readin = new BufferedReader(new InputStreamReader(login.getInputStream()));
printout = new PrintWriter(login.getOutputStream(), true);
StringBuffer buf = new StringBuffer();
buf.append("GET ");
buf.append(get);
buf.append(" HTTP/1.1\r\n");
buf.append("Authorization: ");
buf.append("Passport1.4 OrgVerb=GET,OrgURL=http%3A%2F%2Fmessenger%2Emsn%2Ecom,sign-in=");
try {
buf.append(encode(URLEncoder.encode(username, "UTF-8")));
buf.append(",pwd=");
buf.append(encode(URLEncoder.encode(password, "UTF-8")));
} catch (Exception e) {
e.printStackTrace();
return;
}
buf.append(",");
buf.append(args);
buf.append("\r\nHost: ");
buf.append(host);
buf.append("\r\n");
System.out.println("Get - "+buf.toString());
printout.println(buf.toString());
data = readin.readLine();
while (data != null) {
System.out.println(data);
if (data.startsWith("Location:")) {
redirect = true;
host = data.substring(data.indexOf("://")+3);
get = host.substring(host.indexOf("/"));
host = host.substring(0, host.indexOf("/"));
} else if (data.startsWith("Authentication-Info: ")) {
StringTokenizer tok = new StringTokenizer(data.substring(data.indexOf("da-status=")), ",");
while (tok.hasMoreTokens()) {
data = tok.nextToken();
if (data.startsWith("from-PP=")) {
auth = data.substring(9, data.length()-1);
}
}
}
data = readin.readLine();
}
}
//声明、传递、鉴别用户身份
message="USR "+command+" TWN S "+auth;
System.out.println(message);
out.println(message);
temp=in.readLine();
System.out.println(temp);
}
//设置状态
public void setStatus() throws Exception{
//要求改变状态
message="CHG "+command+" NLN";
out.println(message);
temp=in.readLine();
while(!temp.startsWith("CHL")){
temp=in.readLine();
System.out.println(temp);
}
//客户端回答服务器的验证要求
StringTokenizer st=new StringTokenizer(temp);
st.nextToken();
message="QRY "+command+" msmsgs@msnmsgr.com 32";
out.println(message);
st.nextToken();
String hash=st.nextToken();
String enc = hash+"Q1P7W2E4J9R8U3S5";
MessageDigest digest = MessageDigest.getInstance("MD5");
enc = byteArrayToHexString(digest.digest(enc.getBytes()));
out.print(enc);
out.flush();
temp=in.readLine();
System.out.println("here:"+temp);
}
//发送消息
public boolean send(String remoteusername,String instantmessage) throws Exception{
String rusername=remoteusername;
String imessage=instantmessage;
//询问转接服务器在哪
message="XFR "+command+" SB";
out.println(message);
command++;
temp=in.readLine();
System.out.println(temp);
if(!temp.startsWith("XFR")) return false;
//连接转接服务器
StringTokenizer st=new StringTokenizer(temp);
int cmd=0;
st.nextToken();st.nextToken();st.nextToken();
String []split=st.nextToken().split(":");
Socket swtserver=new Socket(split[0],Integer.parseInt(split[1]));//转接服务器
swtserver.setTrafficClass(0x10);
st.nextToken();
message="USR "+cmd+" "+username+" "+st.nextToken();
cmd++;
System.out.println(message);
PrintWriter swtout=new PrintWriter(swtserver.getOutputStream(),true);
MSNFilterStream swtin=new MSNFilterStream(new BufferedInputStream(swtserver.getInputStream()));
swtout.println(message);
temp=swtin.readLine();
System.out.println(temp);
//发送消息
System.out.println("发送消息");
message="CAL "+cmd+" "+rusername;
cmd++;
swtout.println(message);
System.out.println(message);
temp=swtin.readLine();
System.out.println(temp);
temp=swtin.readLine();
System.out.println(temp);
if(!temp.startsWith("JOI")) return false;
String txt= "MIME-Version: 1.0\r\n";
txt=txt+"Content-Type: text/x-msmsgscontrol\r\n"+"TypingUser: "+username+"\r\n\r\n\r\n";
message="MSG "+cmd+" U"+" "+txt.length()+ "\r\n" + txt;
cmd++;
System.out.println(message);
swtout.print(message);
swtout.flush();
txt = "MIME-Version: 1.0\r\n";
txt = txt+"Content-Type: text/plain; charset=UTF-8\r\n"+
"X-MMS-IM-Format: FN=%E5%AE%8B%E4%BD%93; EF=; CO=0; CS=86; PF=0\r\n\r\n"+imessage;
message="MSG "+cmd+" N"+" "+txt.length()+ "\r\n" + txt;
System.out.println(message);
swtout.print(message);
swtout.flush();
temp=swtin.readLine();
System.out.println(temp);
swtin.close();
swtout.close();
return true;
}
//退出
public void close() throws Exception{
flag=false;
in.close();
out.close();
}
private static String encode(String encodedString) {
String data;
for (int i = 0; i < encodedString.length(); i++) {
if ( encodedString.charAt(i) == '+' ) {
data = encodedString.substring(0, i);
data += "%20" + encodedString.substring(i+1);
encodedString = data;
}
}
return encodedString;
}
private static String byteArrayToHexString (byte[] bytes) {
String hexString = "";
for (int i = 0; i < bytes.length; i++) {
byte b = bytes[i];
hexString = hexString + byteToHexString(b & 0xf, (b >> 4) & 0xf);
}
return hexString;
}
private static String byteToHexString (int nib1, int nib2) {
char char1, char2;
char1 = nibbleToChar (nib1);
char2 = nibbleToChar (nib2);
char[] chars = new char[2];
chars[0] = char2;
chars[1] = char1;
return (new String (chars));
}
private static char nibbleToChar (int nibble) {
if (nibble < 10) {
return (Integer.toString (nibble)).charAt(0);
} else {
int nib = nibble - 10;
return (char)(((char) nib) + 'a');
}
}
}
3. LogInputStream类
/**
* Author EvilgoD
* QQ:7771465
* blog:http://evilgod.iteye.com
* Date 2008-1-8
*/
import java.io.IOException;
import java.io.InputStream;
class LogInputStream extends InputStream {
private InputStream in;
public LogInputStream(InputStream in) {
this.in = in;
}
public int read() throws IOException {
int value = in.read();
return value;
}
public int available() throws IOException {
return in.available();
}
public int read(byte[] b) throws IOException {
int value = in.read(b);
return value;
}
public int read(byte[] b, int off, int len) throws IOException {
int value = in.read(b, off, len);
return value;
}
public void close() throws IOException {
in.close();
}
}
4. MSNFilterStream类
/**
* Author EvilgoD
* QQ:7771465
* blog:http://evilgod.iteye.com
* Date 2008-1-8
*/
import java.io.ByteArrayOutputStream;
import java.io.FilterInputStream;
import java.io.IOException;
import java.io.InputStream;
class MSNFilterStream extends FilterInputStream{
public MSNFilterStream(InputStream in) {
super(in);
}
public String readLine() throws IOException {
boolean prevReturn = false;
ByteArrayOutputStream b = new ByteArrayOutputStream(128);
while(true) {
int value = this.in.read();
if (value<0)
return "null";
if (value=='\r') {
if (prevReturn) {
b.write('\r');
} else {
prevReturn = true;
}
} else {
if (value == '\n') {
// we are ready, we get \r\n
return new String(b.toByteArray(),"UTF-8");
} else {
prevReturn = false;
b.write(value);
}
}
}
}
}
这里只考虑了如何实现msn发消息的功能,至于面向对象,线程之类的暂时没考虑那么多,大家就将就一下了。。。
1.主类:
/**
* Author EvilgoD
* QQ:7771465
* blog:http://evilgod.iteye.com
* Date 2008-1-8
*/
public class MyMSN{
public static void main(String []args) throws Exception {
String username="urname@xxx.com";
String password="urpsw";
String remoteusername="urfriend@xxx.com";
String instantmessage="test!";
MSNServer server=new MSNServer(username,password);
server.login();
server.setStatus();
server.send(remoteusername,instantmessage);
server.close();
}
}
2. MSNServer类:
/**
* Author EvilgoD
* QQ:7771465
* blog:http://evilgod.iteye.com
* Date 2008-1-8
*/
import java.io.*;
import java.net.*;
import java.util.*;
import java.security.*;
import javax.net.ssl.*;
public class MSNServer{
public String username,password;
private int command=0;//流水号
private Socket server;
private PrintWriter out;
private MSNFilterStream in;
public String temp;
public MSNServer(String username,String password){
this.username=username;
this.password=password;
}
//登录
public void login() throws Exception{
server = new Socket("messenger.hotmail.com", 1863);
server.setTrafficClass(0x10);
out = new PrintWriter(server.getOutputStream(), true);
in=new MSNFilterStream(new BufferedInputStream(server.getInputStream()));
//报告协议号
message="VER "+command+" MSN10 MSNP9 CVRO ";
out.println(message);
command++;
temp=in.readLine();
System.out.println(temp);
//报告本机消息
message="CVR "+command+" 0x0804 winnt 5.2 i386 MSNMSGR 7.5.0299 MSMSGS "+username+" ";
out.println(message);
command++;
temp=in.readLine();
System.out.println(temp);
//提交登录用户名
message="USR "+command+" TWN I "+username+" ";
out.println(message);
command++;
temp=in.readLine();
System.out.println(temp);
//连接到ns服务器
StringTokenizer st=new StringTokenizer(temp);
st.nextToken();st.nextToken();st.nextToken();
String ns=st.nextToken();//NS地址
out.close();//关闭与DS服务器的连接
in.close();
server.close();
String []split=ns.split(":");
server=new Socket(split[0],Integer.parseInt(split[1]));
server.setTrafficClass(0x10);
out = new PrintWriter(server.getOutputStream(), true);
in=new MSNFilterStream(new BufferedInputStream(server.getInputStream()));
message="VER "+command+" MSN10 MSNP9 CVR0";
command++;
out.println(message);
temp=in.readLine();
System.out.println(temp);
//报告本机信息
message="CVR "+command+" 0x0804 winnt 5.2 i386 MSNMSGR 7.5.0299 MSMSGS "+username+" ";
out.println(message);
command++;
temp=in.readLine();
//发送用户信息
message="USR "+command+" TWN I "+username+" ";
out.println(message);
command++;
//!验证登录信息,首先在HTTPS端口443向nexus.passport.com发送一个GET请求,将账号、密码和NS给定的一长串信息送出
temp=in.readLine();
System.out.println(temp);
st=new StringTokenizer(temp);
st.nextToken();st.nextToken();st.nextToken();st.nextToken();
String args=st.nextToken();
Socket login = new Socket("nexus.passport.com", 443);
login = ((SSLSocketFactory)SSLSocketFactory.getDefault()).createSocket(login, "nexus.passport.com", 443, true);
BufferedReader readin = new BufferedReader(new InputStreamReader(new LogInputStream(login.getInputStream())));
PrintWriter printout = new PrintWriter(login.getOutputStream(), true);
printout.println("GET /rdr/pprdr.asp");
String host = null;
String get = null;
String data = readin.readLine();
while (data != null) {
System.out.println(data);
if (data.startsWith("PassportURLs:")) {
data = data.substring(14);
StringTokenizer tok = new StringTokenizer(data, ",");
while (tok.hasMoreTokens()) {
String tmp = tok.nextToken();
if (tmp.startsWith("DALogin=")) {
tmp = tmp.substring(8);
host = tmp.substring(0, tmp.indexOf("/"));
get = tmp.substring(tmp.indexOf("/"));
}
}
}
data = readin.readLine();
}
boolean redirect = true;
String auth = null;
//根据情况,会重定向到不同的URL;然后,重新向指定的URL发出请求
while (redirect) {
redirect = false;
login = new Socket(host, 443);
login = ((SSLSocketFactory)SSLSocketFactory.getDefault()).createSocket(login, host, 443, true);
readin = new BufferedReader(new InputStreamReader(login.getInputStream()));
printout = new PrintWriter(login.getOutputStream(), true);
StringBuffer buf = new StringBuffer();
buf.append("GET ");
buf.append(get);
buf.append(" HTTP/1.1\r\n");
buf.append("Authorization: ");
buf.append("Passport1.4 OrgVerb=GET,OrgURL=http%3A%2F%2Fmessenger%2Emsn%2Ecom,sign-in=");
try {
buf.append(encode(URLEncoder.encode(username, "UTF-8")));
buf.append(",pwd=");
buf.append(encode(URLEncoder.encode(password, "UTF-8")));
} catch (Exception e) {
e.printStackTrace();
return;
}
buf.append(",");
buf.append(args);
buf.append("\r\nHost: ");
buf.append(host);
buf.append("\r\n");
System.out.println("Get - "+buf.toString());
printout.println(buf.toString());
data = readin.readLine();
while (data != null) {
System.out.println(data);
if (data.startsWith("Location:")) {
redirect = true;
host = data.substring(data.indexOf("://")+3);
get = host.substring(host.indexOf("/"));
host = host.substring(0, host.indexOf("/"));
} else if (data.startsWith("Authentication-Info: ")) {
StringTokenizer tok = new StringTokenizer(data.substring(data.indexOf("da-status=")), ",");
while (tok.hasMoreTokens()) {
data = tok.nextToken();
if (data.startsWith("from-PP=")) {
auth = data.substring(9, data.length()-1);
}
}
}
data = readin.readLine();
}
}
//声明、传递、鉴别用户身份
message="USR "+command+" TWN S "+auth;
System.out.println(message);
out.println(message);
temp=in.readLine();
System.out.println(temp);
}
//设置状态
public void setStatus() throws Exception{
//要求改变状态
message="CHG "+command+" NLN";
out.println(message);
temp=in.readLine();
while(!temp.startsWith("CHL")){
temp=in.readLine();
System.out.println(temp);
}
//客户端回答服务器的验证要求
StringTokenizer st=new StringTokenizer(temp);
st.nextToken();
message="QRY "+command+" msmsgs@msnmsgr.com 32";
out.println(message);
st.nextToken();
String hash=st.nextToken();
String enc = hash+"Q1P7W2E4J9R8U3S5";
MessageDigest digest = MessageDigest.getInstance("MD5");
enc = byteArrayToHexString(digest.digest(enc.getBytes()));
out.print(enc);
out.flush();
temp=in.readLine();
System.out.println("here:"+temp);
}
//发送消息
public boolean send(String remoteusername,String instantmessage) throws Exception{
String rusername=remoteusername;
String imessage=instantmessage;
//询问转接服务器在哪
message="XFR "+command+" SB";
out.println(message);
command++;
temp=in.readLine();
System.out.println(temp);
if(!temp.startsWith("XFR")) return false;
//连接转接服务器
StringTokenizer st=new StringTokenizer(temp);
int cmd=0;
st.nextToken();st.nextToken();st.nextToken();
String []split=st.nextToken().split(":");
Socket swtserver=new Socket(split[0],Integer.parseInt(split[1]));//转接服务器
swtserver.setTrafficClass(0x10);
st.nextToken();
message="USR "+cmd+" "+username+" "+st.nextToken();
cmd++;
System.out.println(message);
PrintWriter swtout=new PrintWriter(swtserver.getOutputStream(),true);
MSNFilterStream swtin=new MSNFilterStream(new BufferedInputStream(swtserver.getInputStream()));
swtout.println(message);
temp=swtin.readLine();
System.out.println(temp);
//发送消息
System.out.println("发送消息");
message="CAL "+cmd+" "+rusername;
cmd++;
swtout.println(message);
System.out.println(message);
temp=swtin.readLine();
System.out.println(temp);
temp=swtin.readLine();
System.out.println(temp);
if(!temp.startsWith("JOI")) return false;
String txt= "MIME-Version: 1.0\r\n";
txt=txt+"Content-Type: text/x-msmsgscontrol\r\n"+"TypingUser: "+username+"\r\n\r\n\r\n";
message="MSG "+cmd+" U"+" "+txt.length()+ "\r\n" + txt;
cmd++;
System.out.println(message);
swtout.print(message);
swtout.flush();
txt = "MIME-Version: 1.0\r\n";
txt = txt+"Content-Type: text/plain; charset=UTF-8\r\n"+
"X-MMS-IM-Format: FN=%E5%AE%8B%E4%BD%93; EF=; CO=0; CS=86; PF=0\r\n\r\n"+imessage;
message="MSG "+cmd+" N"+" "+txt.length()+ "\r\n" + txt;
System.out.println(message);
swtout.print(message);
swtout.flush();
temp=swtin.readLine();
System.out.println(temp);
swtin.close();
swtout.close();
return true;
}
//退出
public void close() throws Exception{
flag=false;
in.close();
out.close();
}
private static String encode(String encodedString) {
String data;
for (int i = 0; i < encodedString.length(); i++) {
if ( encodedString.charAt(i) == '+' ) {
data = encodedString.substring(0, i);
data += "%20" + encodedString.substring(i+1);
encodedString = data;
}
}
return encodedString;
}
private static String byteArrayToHexString (byte[] bytes) {
String hexString = "";
for (int i = 0; i < bytes.length; i++) {
byte b = bytes[i];
hexString = hexString + byteToHexString(b & 0xf, (b >> 4) & 0xf);
}
return hexString;
}
private static String byteToHexString (int nib1, int nib2) {
char char1, char2;
char1 = nibbleToChar (nib1);
char2 = nibbleToChar (nib2);
char[] chars = new char[2];
chars[0] = char2;
chars[1] = char1;
return (new String (chars));
}
private static char nibbleToChar (int nibble) {
if (nibble < 10) {
return (Integer.toString (nibble)).charAt(0);
} else {
int nib = nibble - 10;
return (char)(((char) nib) + 'a');
}
}
}
3. LogInputStream类
/**
* Author EvilgoD
* QQ:7771465
* blog:http://evilgod.iteye.com
* Date 2008-1-8
*/
import java.io.IOException;
import java.io.InputStream;
class LogInputStream extends InputStream {
private InputStream in;
public LogInputStream(InputStream in) {
this.in = in;
}
public int read() throws IOException {
int value = in.read();
return value;
}
public int available() throws IOException {
return in.available();
}
public int read(byte[] b) throws IOException {
int value = in.read(b);
return value;
}
public int read(byte[] b, int off, int len) throws IOException {
int value = in.read(b, off, len);
return value;
}
public void close() throws IOException {
in.close();
}
}
4. MSNFilterStream类
/**
* Author EvilgoD
* QQ:7771465
* blog:http://evilgod.iteye.com
* Date 2008-1-8
*/
import java.io.ByteArrayOutputStream;
import java.io.FilterInputStream;
import java.io.IOException;
import java.io.InputStream;
class MSNFilterStream extends FilterInputStream{
public MSNFilterStream(InputStream in) {
super(in);
}
public String readLine() throws IOException {
boolean prevReturn = false;
ByteArrayOutputStream b = new ByteArrayOutputStream(128);
while(true) {
int value = this.in.read();
if (value<0)
return "null";
if (value=='\r') {
if (prevReturn) {
b.write('\r');
} else {
prevReturn = true;
}
} else {
if (value == '\n') {
// we are ready, we get \r\n
return new String(b.toByteArray(),"UTF-8");
} else {
prevReturn = false;
b.write(value);
}
}
}
}
}
评论
3 楼
haoyun2020
2009-12-15
message是什么类型的数据?
2 楼
goodluck168
2008-12-22
试试看,能否使用
1 楼
tedeyang
2008-01-10
是要顶的。
相关推荐
在本文中,我们将深入探讨如何使用Java来实现MSN(Microsoft Messenger Service)的收发消息功能。MSN曾经是一款流行的即时通讯软件,尽管它现在已经不再维护,但它的协议仍然是学习网络通信和即时消息处理的一个...
【标题】:“用JAVA实现MSN Messenger的功能” 在Java编程领域,实现类似MSN Messenger的功能是一项具有挑战性的任务,因为这涉及到即时通讯(IM)系统的设计与开发。MSN Messenger,虽然已经停服,但其核心功能...
【Java实现MSN Messenger功能】 本文将探讨如何使用Java语言实现MSN Messenger的功能,主要涉及的知识点包括Java编程、即时通讯协议(IM)、JML库以及相关的第三方库。 **JML库介绍** JML(Java Messenger Library...
Java版MSN是一款基于Java语言开发的即时通讯软件,它的出现为开发者提供了一个了解和学习如何用Java实现网络通信和即时消息传递的实例。这个压缩包包含的资源是关于Java MSN项目的源码,对于Java开发者,尤其是对...
Java版的即时通信软件,正如标题所提及的“Java版msn即时通信软件”,是一种基于Java编程语言开发的在线通讯工具,旨在实现类似MSN Messenger的功能。MSN Messenger是微软公司曾经推出的一款广泛使用的即时通讯应用...
JavaMSN项目是一个基于Java语言实现的MSN Messenger接口,它允许开发者通过编程方式与MSN网络进行交互,实现诸如发送和接收消息、管理联系人列表、处理在线状态更新等功能。这个项目通常对那些希望在自己的应用程序...
在Java中实现MSN系统,开发者可能使用了Java Swing或JavaFX库来构建用户界面,这些库提供了丰富的组件和API,可以方便地创建图形化界面。同时,为了处理用户交互和业务逻辑,可能使用了Java的Servlet或Spring框架。...
4. **XML解析**:MSN Messenger服务可能使用XML格式的数据进行交换,因此JavaMSN可能需要解析XML来获取或发送消息。Java的标准库中包含`javax.xml.parsers`包,提供了DOM和SAX两种XML解析方法。 5. **图形用户界面...
在本压缩包“基于java的msn聊天程序Java仿真代码.zip”中,包含的是一个使用Java编程语言实现的MSN(Microsoft Network)聊天程序的源代码。这个程序是开发者通过Java技术来模拟MSN即时通讯功能的一个实例,对于学习...
Java模仿的MSN聊天软件是一个基于Java编程语言实现的即时通讯应用,它借鉴了早期流行的MSN Messenger的功能和设计,旨在提供类似的文字、语音甚至视频聊天体验。在这个项目中,开发者使用Java的技术栈来创建一个...
这些库提供了丰富的组件和设计工具,用于创建图形用户界面,如文本框、按钮、菜单等,以实现MSN的基本功能。 2. **网络通信**:Java的Socket编程是TjMSN实现即时通讯的基础。通过TCP/IP协议,程序能与MSN服务器建立...
MSN曾经是一款流行的即时通讯软件,而这个项目是其功能的Java版本实现。通过分析和学习这个代码库,我们可以深入理解如何在Java中构建类似的实时通讯应用。 【描述】中的内容与标题一致,确认了这是一个关于Java...
由于MSN Messenger在2013年已停服,这款Java版的程序可能是一个开源或者非官方的替代品,允许用户通过网络进行文字聊天、语音通话、文件传输等功能。 Java作为一种跨平台的编程语言,使得这个Java版的MSN程序具有...
这个项目展示了如何利用Java技术实现一个类似MSN的功能,包括用户登录、发送消息、接收消息以及基本的社交功能。JavaMSN是学习Java网络编程和GUI设计的一个良好实践案例。 在Java中,实现聊天功能的关键在于理解...
在本文中,我们将深入探讨这个项目的核心概念、技术栈以及如何使用Java实现即时通讯(IM)软件。 【描述】"用JAVA编写的类似于msn聊天程序"意味着开发者利用Java的强大功能和面向对象特性,构建了一个可以实现实时...
Java版MSN是一款基于Java编程语言实现的即时通讯软件,它允许用户通过网络进行实时聊天、文件传输、状态更新等常见的MSN功能。Java的跨平台特性使得这款应用可以在多种操作系统上运行,包括Windows、Linux和Mac OS等...
JavaMSN实例是一个基于Java编程语言实现的项目,它展示了如何使用Java来登录MSN即时...通过这个实例,开发者可以学习到如何用Java实现一个基本的即时通讯客户端,这对于理解网络应用开发和协议实现有着重要的实践意义。