package test;
import org.jivesoftware.smack.Chat;
import org.jivesoftware.smack.ConnectionConfiguration;
import org.jivesoftware.smack.XMPPConnection;
import org.jivesoftware.smack.XMPPException;
public class Smacks {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
ConnectionConfiguration config = new ConnectionConfiguration("b02", 5222);
XMPPConnection connection = new XMPPConnection(config);
try {
connection.connect();
connection.login("admin", "adminss");
if(connection.isAuthenticated()){
System.out.println("登陆成功!");
}
else{
System.out.println("登陆失败!");
}
} catch (XMPPException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}