close
using XihSolutions.DotMSN;  
using XihSolutions.DotMSN.Core;  
using XihSolutions.DotMSN.DataTransfer;  
  
 
Messenger messenger;  
 
public void myConnect()  
{  
    messenger = new Messenger();  
    messenger.Credentials.ClientID = "
msmsgs@msnmsgr.com";  
    messenger.Credentials.ClientCode = "Q1P7W2E4J9R8U3S5";  
    messenger.Nameserver.SignedIn += new EventHandler(Nameserver_SignedIn);  
    messenger.Credentials.Account = "*****";  
    messenger.Credentials.Password = "****";  
    messenger.Connect();  
}  
 
void Nameserver_SignedIn(object sender, EventArgs e)  
{  
    UpdateUI(delegate 
    {  
        if (!messenger.Connected)  
            return;  
         
        foreach (Contact contact in messenger.ContactList.All)  
        {                     
            listBox1.Items.Add(contact.Mail);                      
        }                 
    });  
 
}  
 
private void UpdateUI(EventHandler action)  
{  
    this.Invoke(action);  
}  
 
private void ContactBtn_Click(object sender, EventArgs e)  
{  
    myConnect();  

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 11 的頭像
    11

    冠霖的部落格

    11 發表在 痞客邦 留言(0) 人氣()