Skype API的实现

可能重复:
C#中的Skype插件

如何实现Skype API以访问C#中的用户信息?

更新:不幸的是,文档不再可用。 但是,下面的代码仍然有效,但是微软长期以来一直计划从Skype中删除对COM自动化的支持。


下载并安装Skype API COM Wrapper可能最简单。

然后,您只需从Visual Studio项目的“ 添加引用”对话框的“COM”选项卡中添加对此包装的引用即可。

以下是一个简短的示例程序,说明如何搜索用户以及如何发送消息:

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"); } } 

只是在这里指出。 下载Skype4COM.dll后,您可能需要使用regsvr32注册dll,在Visual Studio中,您可以将.dll添加为可识别的COM组件!

 regsvr32 C:\Windows\System32\Skype4COM.dll 

例如,您将获得一个弹出窗口,表明它已成功注册它,现在回到您的IDE中,在COM选项卡下的Add Reference中,您将看到Skype库。

希望这可以帮助,

安德鲁

主要的skype下载网站不再有用,这里是一面镜子:

https://sites.google.com/site/appanalyzecomponent/skype4com

如果您意味着从ASP.NET访问特定用户的状态。

所以,你想知道那个人是否有空。 将图片链接添加到此url。

  

skyname是您想要显示状态的人。

为Skype的个人资料建立链接

 Joe Doe's Profile 

但如果您想以其他方式执行此操作,例如Code-Behind – 那么此链接应提供您需要的所有示例 – https://developer.skype.com/Docs/Skype4COM/Example?action=show

 IUserCollection iusercollection = skype.SearchForUsers("echo123"); if (iusercollection.Count > 0) { Console.WriteLine(iusercollection[0].FullName); } 

所有IUser接口的列表可以在https://developer.skype.com/Docs/Skype4COMLib/IUser找到

希望这可以帮助