lync 2010 sdk可以';无法捕获收到的对话消息

lync 2010 sdk可以';无法捕获收到的对话消息,sdk,lync-2010,Sdk,Lync 2010,我使用lync 2010 sdk并使用lync wpf应用程序进行开发。 我可以向某个组或个人发送消息,但无法捕获收到的消息文本 就像代码一样,ı可以在添加新对话时捕获,但也不能读取消息文本 有人知道怎么做吗 private Conversation _conversation; LyncClient _LyncClient; void ConversationManager_ConversationAdded(object sender, Microsoft.Lync.Model

我使用lync 2010 sdk并使用lync wpf应用程序进行开发。 我可以向某个组或个人发送消息,但无法捕获收到的消息文本

就像代码一样,ı可以在添加新对话时捕获,但也不能读取消息文本

有人知道怎么做吗

  private Conversation _conversation;
  LyncClient _LyncClient;

  void ConversationManager_ConversationAdded(object sender, Microsoft.Lync.Model.Conversation.ConversationManagerEventArgs e)
    {
        if (_conversation == null)
        {
            _conversation = e.Conversation;
        }
         string getmessage=_conversation.GetApplicationData(_AppId);
        _conversation.ParticipantAdded += _conversation_ParticipantAdded;
        if (_conversation.Modalities[ModalityTypes.InstantMessage].State != ModalityState.Notified)
        {
            _RemoteContact = _LyncClient.ContactManager.GetContactByUri("sip:xxx @xxx.com.tr");
            _conversation.AddParticipant(_RemoteContact);
        }
        e.Conversation.InitialContextReceived += Conversation_InitialContextReceived;
        e.Conversation.ContextDataReceived += Conversation_ContextDataReceived;
        e.Conversation.StateChanged += Conversation_StateChanged;
        ((InstantMessageModality)e.Conversation.Modalities[ModalityTypes.InstantMessage]).InstantMessageReceived += MainWindow_InstantMessageReceived;
    }

您在上面使用的事件是用于上下文数据的,如果您想要获取IM文本,这些数据可能不是您想要的。您想要的事件是InstantMessageReceived事件。以下文章对此进行了描述(这是Lync 2013年的一篇文章,但也适用于2010年):

在这里,您可以看到该文章中某一部分的屏幕盖: