如何创建自动消息? [英] How to create an automatic message?

查看:69
本文介绍了如何创建自动消息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



I有几个问题:



1。我没有确切地找到如何创建消息文本并将其发送给联系人,我确实找到了如何打开对话窗口,但我如何以编程方式输入我自己的文本?


2。有没有办法在不打开UI窗口的情况下打开会话会话?我看到IMessengerPrivate只支持addContact(并启用尚不支持的警报)。


3。关于问题1,如果有办法发送消息,可以在传播者2005中完成,还是必须在2007年?



提前致谢


解决方案


class program
{< br> static void Main(string [] args)
{
CommunicatorAPI.MessengerClass communicator = new CommunicatorAPI.MessengerClass();


communicator.OnIMWindowCreated + = new CommunicatorAPI.DMessengerEvents_OnIMWindowCreatedEventHandler (communicator_OnIMWindowCreated);


communicator.AutoSignin();


CommunicatorAPI.IMessengerAdvanced msgrAdv = communicator as CommunicatorAPI.IMessengerAdvanced;


object [] sipUris = new object [] < br> {
" wanbo@intranet.demo "
};


对象窗口= msgrAdv.StartConversation(CommunicatorAPI.CONVERSATION_TYPE.CONVERSATION_TYPE_IM,sipUris,null," Testing"," 1",null);
}


static void communicator_OnIMWindowCreated(object pIMWindow)
{
CommunicatorAPI.IMessengerConversationWndAdvanced imWindow = pIMWindow as CommunicatorAPI.IMessengerConversationWndAdvanced;
imWindow.SendText(" Hello");
}
}


 

Hi,

I have a few questions:

 

1. I didn't find exactly how can I create a message text and send it to contacts, I did find how to open a conversation window, but how I enter my own text programmatically?

2. Is there a way to open a conversation session without opening a UI window? I saw that the IMessengerPrivate supports only addContact (and Enable alerts that is not supported yet).

3. In regarding to question 1, if there is a way to send message, can it be done in communicator 2005, or it has to be 2007?

 

Thanks in advance

 

解决方案

 

    class Program
    {
        static void Main(string[] args)
        {
            CommunicatorAPI.MessengerClass communicator = new CommunicatorAPI.MessengerClass();

            communicator.OnIMWindowCreated += new CommunicatorAPI.DMessengerEvents_OnIMWindowCreatedEventHandler(communicator_OnIMWindowCreated);

            communicator.AutoSignin();

            CommunicatorAPI.IMessengerAdvanced msgrAdv = communicator as CommunicatorAPI.IMessengerAdvanced;

            object[] sipUris = new object[]
            {
                "wanbo@intranet.demo"
            };

            object window = msgrAdv.StartConversation(CommunicatorAPI.CONVERSATION_TYPE.CONVERSATION_TYPE_IM, sipUris, null, "Testing", "1", null);
        }

        static void communicator_OnIMWindowCreated(object pIMWindow)
        {
            CommunicatorAPI.IMessengerConversationWndAdvanced imWindow = pIMWindow as CommunicatorAPI.IMessengerConversationWndAdvanced;
            imWindow.SendText("Hello");
        }
    }


这篇关于如何创建自动消息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆