【问题标题】:How to display image as a reply using UCMA skype for business如何使用 UCMA Skype for business 将图像显示为回复
【发布时间】:2017-02-15 21:26:31
【问题描述】:

我创建了一个应用程序,将用户连接到幕后的聊天机器人。文本工作正常时聊天机器人的响应,但我还需要在必要时显示图像。有没有人可以使用任何方向或代码sn-p。我有这段代码不起作用

FileStream fs = File.OpenRead(@"C:\data\logo2.png");
                var fileBytes = new byte[fs.Length];
                fs.Read(fileBytes, 0, fileBytes.Length);

                ContentType ct = new ContentType("image/png");
                ct.CharSet = "UTF-8";

                byte[] bytes1 = Encoding.UTF8.GetBytes(fileBytes.ToString());

                _instantMessagingFlow.BeginSendInstantMessage(ct, bytes1, SendMessageCompleted,
                _instantMessagingFlow);

【问题讨论】:

    标签: c# skype-for-business ucma


    【解决方案1】:

    我能够通过使用来解决它 MimePartContentDescription(new ContentType("multipart/alternative").

    出于正当原因,我无法粘贴工作代码 - 但如果您查找 MimePartContentDescription(new ContentType("multipart/alternative") 您应该会看到能够阅读文档/示例以供使用。

    我确实有根据大小显示图像的限制 - 任何小于 40kb 的东西都可以。它对我来说不是一个展示停止器,因为在我的用例中图像实际上很小。我暂时将其标记为已回答,但如果有人知道为什么我很想知道为什么有六个限制。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-03-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多