sending message in a skype group conversation through vc#

ぃ、小莉子 提交于 2019-12-23 20:06:50

问题


How can I send the message in a group conversation of skype chat through vc#.

Though I have included the skype reference in my application and can get some chats.

Thanks.


回答1:


You need a reference to an IChat interface.

You can get such a reference using ISkype.Chat property.

Once you have the IChat reference it is just a matter of calling SendMessage() method.

If you like to you can take a look in a Skype plugin I wrote here. (You don't need to understand the whole application of course. Just take a look in Application class defined in Application.cs)

[Edited]

Some sample code

using System;
using System.Windows.Forms;
using SKYPE4COMLib;

namespace SkypeClient
{
    public partial class Form1 : Form
    {
            public Form1()
            {
                InitializeComponent();
            }

            private void button1_Click(object sender, EventArgs e)
            {
                 ISkype skype = new SkypeClass();
                 skype.Attach(5, true);

                 int count = skype.Chats.Count;
                 textBox1.Text = "Count: " + count + "\r\n";
                 foreach (IChat chat in skype.Chats)
                 {
                    textBox1.Text +=  "\r\n"  + chat.FriendlyName;
                 }
            }
       }
 }

Hope this helps.



来源:https://stackoverflow.com/questions/4314653/sending-message-in-a-skype-group-conversation-through-vc

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!