问题描述
限时送ChatGPT账号..可能的重复:
C# 中的 Skype 插件
如何在 C# 中实现 Skype API 访问用户信息?
How can I implement the Skype API to access user information in C#?
推荐答案
更新:不幸的是,文档不再可用.虽然有可能,下面的代码仍然有效,但微软早就计划从 Skype 中删除对 COM 自动化的支持.
UPDATE: Unfortunately, the documentation is no longer available. There is a chance though, that the below code still works, but afaik Microsoft has long planned to remove support for COM automation from Skype.
下载并安装 Skype API COM Wrapper一>.
It is probably easiest to download and install the Skype API COM Wrapper.
然后,您只需从 Visual Studio 项目中添加引用对话框的 COM 选项卡添加对此包装器的引用.
Then you can simply add a reference to this wrapper from the COM tab of the Add References dialog in your Visual Studio project.
下面是一个简短的示例程序,说明如何搜索用户以及如何发送消息:
Below is a short sample program illustrating how to search for a user and how to send a message:
using System;
using SKYPE4COMLib;
class Program
{
static void Main(string[] args)
{
Skype skype = new Skype();
if (!skype.Client.IsRunning)
{
// start minimized with no splash screen
skype.Client.Start(true, true);
}
// wait for the client to be connected and ready
skype.Attach(6, true);
// access skype objects
Console.WriteLine("Missed message count: {0}", skype.MissedMessages.Count);
// do some stuff
Console.WriteLine("Enter a skype name to search for: ");
string username = Console.ReadLine();
foreach (User user in skype.SearchForUsers(username))
{
Console.WriteLine(user.FullName);
}
Console.WriteLine("Say hello to: ");
username = Console.ReadLine();
skype.SendMessage(username, "Hello World");
}
}
这篇关于Skype API 的实现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
更多推荐
[db:关键词]
发布评论