C# Skype API消息输出

C# Skype API消息输出,c#,skype,skype4com,C#,Skype,Skype4com,我如何从Skype接收消息并将其输出到我的应用程序(textbox1.Text)? 我在skype4com文档中查找它,但什么也没找到 要收听聊天信息,您可以执行以下操作: //First make a reference to skype4com, probably in here: C:\Program Files (x86)\Common Files\Skype //Then use the following code: using System; using System.Window

我如何从Skype接收消息并将其输出到我的应用程序(
textbox1.Text
)?
我在skype4com文档中查找它,但什么也没找到

要收听聊天信息,您可以执行以下操作:

//First make a reference to skype4com, probably in here: C:\Program Files (x86)\Common Files\Skype
//Then use the following code:
using System;
using System.Windows.Forms;
using SKYPE4COMLib;

namespace Skype
{
    public partial class Form1 : Form
    {
        private SKYPE4COMLib.Skype skype;

        public Form1()
        {
            InitializeComponent();
            skype = new SKYPE4COMLib.Skype();
            skype.Attach(7, false);
            skype.MessageStatus += new _ISkypeEvents_MessageStatusEventHandler(skype_MessageStatus);
        }

        private void skype_MessageStatus(ChatMessage msg, TChatMessageStatus status)
        {
            string message = msg.Sender + ": " + msg.Body;
            listBox1.Items.Add(message);
        }
    }
}

什么样的信息?Skype聊天文本?不幸的是,在Skype窗口打开之前不会触发该事件。这很奇怪,也很令人失望。@alehro:我也面临着同样的问题,只有在skype窗口打开的情况下才能调用代码,你有没有找到解决方案。@Dr.RajeshRolen不,我没有。我实际上切换到了Skype预览。它有用于机器人开发的API。所以,下次我会朝这个方向看。目前Skype Preview存在连接问题,我正在等待它们得到修复,然后再投入时间进行修复。