如何让用户在botframework中发送图像附件

[Serializable]

public class VehicleForm

{

    [Prompt("When did this happen")]

    public DateTime LossDate { get; set; }


    [Prompt("Please upload proof image")]

    public byte Picture { get; set; }

我希望用户能够在机器人框架中填写表单时包含图像。我将图片字段声明为字节,但在上传图片时不起作用。这有可能实现吗?如果是,请有人向我介绍如何去做吗?谢谢


达令说
浏览 138回答 1
1回答

慕斯王

SDK Repository 中有一个示例,用于执行此操作。从示例中看来,您需要使用该AwaitableAttachment类型,请查看ImagesForm:// Attachment field has no validation - any attachment would workpublic AwaitableAttachment BestImage;// Attachment field is optional - validation is done through AttachmentContentTypeValidator usage[Optional][AttachmentContentTypeValidator(ContentType = "png")]public AwaitableAttachment SecondaryImage;
打开App,查看更多内容
随时随地看视频慕课网APP