如何以编程方式读取Lync 2013 IM消息

时间:2015-03-26 12:58:15

标签: lync lync-2013 lync-client-sdk

我想以编程方式阅读Lync IM聊天对话。由于Lync Client将其IM日志存储到.HIST文件中。有谁知道.HIST文件的格式或如何读取这个文件?

我还读到,通过使用Lync SDK,我们可以获得Lync IM聊天对话。 http://blog.thoughtstuff.co.uk/2013/01/tracking-lync-conversations-in-code/此博客讲述了如何将音频 - 视频通话对话转换为代码。 谁能告诉我如何实现阅读IM聊天对话?

1 个答案:

答案 0 :(得分:0)

您可以在PaticipantAdded事件下收听InstantMessageRecieved事件。请参阅以下示例代码:

  // Add ParticipantAdded event
  conversation.ParticipantAdded += this.Conversation_ParticipantAdded;

  private void Conversation_ParticipantAdded(object sender, ParticipantCollectionChangedEventArgs e) {
    var instantMessageModality = e.Participant.Modalities[ModalityTypes.InstantMessage] as InstantMessageModality;
    instantMessageModality.InstantMessageReceived += this.Participant_InstantMessageReceived;
  }

  private void Participant_InstantMessageReceived(object sender, MessageSentEventArgs e) {
    // Use e.Text to read the chat information
  }