[英]How to display image as a reply using UCMA skype for business
我创建了一个应用程序,将用户连接到后台的聊天机器人。 当文字正常工作时,聊天机器人的响应很好,但必要时我还需要显示图像。 没有人有我可以使用的任何方向或代码片段。 我有此代码不起作用
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);
我能够通过使用MimePartContentDescription(new ContentType(“ multipart / alternative”)来解决它。
由于适当的原因,我无法粘贴工作代码-但是,如果您寻找MimePartContentDescription(new ContentType(“ multipart / alternative”),则应该能够阅读文档/使用示例。
我确实有根据大小显示图像的限制-小于40kb的任何作品都可以。 对于我来说,这不是一个显示障碍,因为在我的用例中,图像实际上很小。 我现在将其标记为“已回答”,但是如果有人知道为什么我想知道六位数限制。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.