Skype的API消息输出 [英] Skype API Message output
本文介绍了Skype的API消息输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我如何可以接收和输出消息通过Skype给我的应用程序( textbox1.Text
)?
我一直在寻找它skype4com文档中,但没有发现任何东西。
How can I receive and output message from Skype to my application (textbox1.Text
)?
I was looking for it in skype4com documentation but didn't find anything.
推荐答案
要监听聊天消息你可以做这样的事情:
To listen for chat messages you can do something like this:
//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的API消息输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文