public List getMsnList(String number, String password) throws DAOException {
MSNMessenger msn = new MSNMessenger(number, password);
msn.setInitialStatus(UserStatus.ONLINE);
msn.login();
BuddyGroup group = msn.getBuddyGroup();
BuddyList buddyList = group.getAllowList(); List list = new ArrayList();
String loginName = "";
MsnFriend friend = null;
for (Iterator it = buddyList.iterator(); it.hasNext();) {
friend = (MsnFriend) it.next();
loginName = friend.getLoginName();
list.add(loginName); }
return list; } public static void main(String[] args) {
ImService s = new ImService();
List list = null;
try {
list = s.getMsnList("[email protected]", "325800");
} catch (DAOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
System.out.println("11111");
}
msn.logout()后还是处于监听状态
System.exit(0)的话
调用那方法的action就会自己销毁
咋解决啊