Skype API 的实现

发布于 2024-07-30 06:23:09 字数 203 浏览 3 评论 0原文

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

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

Possible Duplicate:
Skype Addon in C#

How can I implement the Skype API to access user information in C#?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

烛影斜 2024-08-06 06:23:10

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

regsvr32 C:\Windows\System32\Skype4COM.dll

例如,您将看到一个弹出窗口,表明已成功注册,现在回到 IDE 中,在 COM 选项卡下的“添加引用”内,您将看到 Skype 库。

希望这有帮助,

安德鲁

Just to point out here. After downloading the Skype4COM.dll you will probably need to use regsvr32 to register the dll, that way inside Visual Studio you can add the .dll as a recognised COM Component!

regsvr32 C:\Windows\System32\Skype4COM.dll

for example, you will get a popup indicating it successfully registered it, and now back in your IDE, inside the Add Reference under the COM Tab you will see the Skype Library.

Hope this helps,

Andrew

白馒头 2024-08-06 06:23:10

主要的 Skype 下载网站已不再上线,这里有一个镜像:

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

The main skype download site is no longer live, here is a mirror:

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

谁许谁一生繁华 2024-08-06 06:23:10

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

因此,您想知道那个人是否有空。 将图像链接添加到此网址。

<img src="http://mystatus.skype.com/smallclassic/skypename" />

其中 skyname 是您要显示状态的人。

要为 Skype 的配置文件创建链接

<a href="skype:skypename?userinfo">Joe Doe's Profile</a>

,但如果您想以其他方式进行操作,例如代码隐藏 - 那么此链接应提供您需要的所有示例 - 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

希望这有帮助

If you means to access status of particular user from ASP.NET.

so, you want to know if that person is available or not. add image link to this url.

<img src="http://mystatus.skype.com/smallclassic/skypename" />

Where skyname is the person that you want to show status.

To make a link for Skype's profile

<a href="skype:skypename?userinfo">Joe Doe's Profile</a>

but if you want to do it other way e.g. Code-Behind - Then this link should provide all example you need - https://developer.skype.com/Docs/Skype4COM/Example?action=show

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

List of all IUser interface can find at https://developer.skype.com/Docs/Skype4COMLib/IUser

Hope this helps

旧人 2024-08-06 06:23:09

更新:不幸的是,该文档不再可用。 不过,下面的代码有可能仍然有效,但据我所知,微软长期以来一直计划从 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");
    }
}

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.


It is probably easiest to download and install the Skype API COM Wrapper.

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");
    }
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文