c# - 如何从复杂的自适应卡中读取值?

标签 c# .net botframework adaptive-cards

如果正文只有输入文本,我就可以读取这些值。这种情况下有 columnset 和 column。当我填写所有输入数据并单击模拟器的提交按钮时,我没有得到任何值。

平台:.Net C#

下面我分享了json卡的详细信息。你能帮我解决这个问题吗?

{
  "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
  "type": "AdaptiveCard",
  "version": "0.5",
  "body": [
    {
      "type": "ColumnSet",
      "columns": [
        {
          "type": "Column",
          "size": 2,
          "items": [
            {
              "type": "TextBlock",
              "text": "Tell us about yourself...",
              "weight": "bolder",
              "size": "large"
            },
            {
              "type": "TextBlock",
              "text": "We just need a few more details to get you booked for the trip of a lifetime!",
              "isSubtle": true,
              "wrap": true
            },
            {
              "type": "TextBlock",
              "text": "Don't worry, we'll never share or sell your information.",
              "isSubtle": true,
              "wrap": true,
              "size": "small"
            },
            {
              "type": "TextBlock",
              "text": "Your name",
              "wrap": true
            },
            {
              "type": "Input.Text",
              "id": "myName",
              "placeholder": "Last, First"
            },
            {
              "type": "TextBlock",
              "text": "Your email",
              "wrap": true
            },
            {
              "type": "Input.Text",
              "id": "myEmail",
              "placeholder": "youremail@example.com",
              "style": "email"
            },
            {
              "type": "TextBlock",
              "text": "Phone Number"
            },
            {
              "type": "Input.Text",
              "id": "myTel",
              "placeholder": "xxx.xxx.xxxx",
              "style": "tel"
            }
          ]
        },
        {
          "type": "Column",
          "size": 1,
          "items": [
            {
              "type": "Image",
              "url": "https://upload.wikimedia.org/wikipedia/commons/b/b2/Diver_Silhouette%2C_Great_Barrier_Reef.jpg",
              "size": "auto"
            }
          ]
        }
      ]
    }
  ],
  "actions": [
    {
      "type": "Action.Submit",
      "title": "Submit"
    }
  ]
}

最佳答案

如果有人看到这个,很老的问题只是为了清楚起见,

潜在的问题在很久以前就已经解决了,如果您使用这样的 AdaptiveCards,无论这些值是否在列集中,您都可以很好地获得所有值。

关于c# - 如何从复杂的自适应卡中读取值?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44388731/

相关文章:

c# - 2 在 c# 中启用可编辑 DataGridViewComboBox(非数据绑定(bind))的问题

c# - DataSet.Locale 有什么作用?

c# - 使用预建实体 datetimeV2 捕获日期范围

Azure 机器人 channel 错误 "There was an error sending this message to your bot: HTTP status code Unauthorized"

c# - 计算旋转时相对于其他点的点位置 - C# XNA

c# - Windows 窗体在闪屏后落后

.net - 具有 ItemsControl 嵌入网格的 SharedGridSize 组

botframework - PromptDialog.Choice 不显示选项

c# - 使用语句和 Entity Framework 实体

c# - 在 JSON.NET 中反序列化的转换接口(interface)