Skype API 的实现

编程入门 行业动态 更新时间:2024-10-25 22:25:59
本文介绍了Skype API 的实现的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送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:关键词]

本文发布于:2023-04-18 16:51:33,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/943754.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Skype   API

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!