Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/295.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何使用UCMA skype for business将图像显示为回复_C#_Skype For Business_Ucma - Fatal编程技术网

C# 如何使用UCMA skype for business将图像显示为回复

C# 如何使用UCMA skype for business将图像显示为回复,c#,skype-for-business,ucma,C#,Skype For Business,Ucma,我创建了一个应用程序,将用户连接到幕后的聊天机器人。聊天机器人的回应,当文字工作正常,但我也需要显示图像时,必要的。有人有我可以使用的方向或代码片段吗。我有一个不起作用的代码 FileStream fs = File.OpenRead(@"C:\data\logo2.png"); var fileBytes = new byte[fs.Length]; fs.Read(fileBytes, 0, fileBytes.Length);

我创建了一个应用程序,将用户连接到幕后的聊天机器人。聊天机器人的回应,当文字工作正常,但我也需要显示图像时,必要的。有人有我可以使用的方向或代码片段吗。我有一个不起作用的代码

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(新的ContentType(“多部分/可选”)

出于适当的原因,我无法粘贴工作代码-但是如果您查找MimePartContentDescription(新ContentType(“multipart/alternative”),您应该能够阅读文档/示例以了解用法

我确实有一个基于大小显示图像的限制-任何小于40kb的都可以。这对我来说不是一个显示障碍,因为在我的用例中图像实际上很小。我现在会将此标记为已回答,但如果有人知道为什么会有六个限制,我很想知道