DOTMsn没有触发SingedIn事件

时间:2010-02-08 06:20:36

标签: msn-messenger

我刚开始使用“XihSolutions.DotMSN.dll”版本构建应用程序:2.0.0.40909,

我的问题是它没有触发“Nameserver_SignedIn”事件。不确定我是否做错了什么。 你的帮助将非常有用。

void Nameserver_SignedIn(object sender,EventArgs e)         {             抛出新的异常(“用户登录”);         }

    private string message = string.Empty;
    void NameserverProcessor_ConnectionEstablished(object sender, EventArgs e)
    {

        message = "Connected";
        SetMessage();

    }

    void SetMessage()
    {
        if (tbMessage.InvokeRequired)
           tbMessage. Invoke(new ThreadStart(SetMessage));
        else
        tbMessage.Text += Environment.NewLine+ message; 
    }

    private void btnSingIn_Click(object sender, EventArgs e)
    {
        if (messenger.Connected)
        {
           // SetStatus("Disconnecting from server");
            messenger.Disconnect();
        }

        // set the credentials, this is ofcourse something every DotMSN program will need to
        // implement.
        messenger.Credentials.Account = tbUserName.Text;
        messenger.Credentials.Password = tbPwd.Text;

        // inform the user what is happening and try to connecto to the messenger network.                
        //SetStatus("Connecting to server");
        messenger.Connect();

    }

1 个答案:

答案 0 :(得分:0)

您可能会使用MSNPSharp - DotMSN已旧,可能不支持当前的MSN协议。链接在这里:

http://code.google.com/p/msnp-sharp/