Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/315.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# 如何在messenger中显示web视图_C#_Webview_Messaging_Botframework_Facebook Messenger Bot - Fatal编程技术网

C# 如何在messenger中显示web视图

C# 如何在messenger中显示web视图,c#,webview,messaging,botframework,facebook-messenger-bot,C#,Webview,Messaging,Botframework,Facebook Messenger Bot,我是这样说的: 我创建了自定义类: [JsonObject(MemberSerialization.OptIn)] public class elements { [JsonProperty] public string title { get; set; } [JsonProperty] public string image_url { get; set; }

我是这样说的:

我创建了自定义类:

[JsonObject(MemberSerialization.OptIn)]
        public class elements
        {
            [JsonProperty]
            public string title { get; set; }
            [JsonProperty]
            public string image_url { get; set; }
            [JsonProperty]
            public string subtitle { get; set; }
            [JsonProperty]
            public default_action default_action { get; set; }
            [JsonProperty]
            public buttons[] buttons { get; set; }
        }
        [JsonObject(MemberSerialization.OptIn)]
        public class default_action
        {

            [JsonProperty]
            public string type { get; set; }

            [JsonProperty]
            public string url { get; set; }
        }
        [JsonObject(MemberSerialization.OptIn)]
        public class buttons
        {

            [JsonProperty]
            public string type { get; set; }

            [JsonProperty]
            public string url { get; set; }

            [JsonProperty]
            public string title { get; set; }
        }
然后,在方法中:

elements e = new elements();

                    e.default_action.type = "web_url";
                    e.default_action.type = "https://www.youtube.com/watch?v=kOkQ4T5WO9E";
                    e.title = "title";

                    List<buttons> list = new List<buttons>();
                    buttons b = new buttons();
                    b.title = "button title";
                    b.type = "web_url";
                    b.url = "https://www.youtube.com/watch?v=kOkQ4T5WO9E";
                    list.Add(b);
                    e.buttons = list.ToArray();

                    msg.ChannelData = e;
                    msg.Text = "test";
元素e=新元素();
e、 默认的\u action.type=“web\u url”;
e、 默认_action.type=”https://www.youtube.com/watch?v=kOkQ4T5WO9E";
e、 title=“title”;
列表=新列表();
按钮b=新按钮();
b、 title=“按钮标题”;
b、 type=“web\u url”;
b、 url=”https://www.youtube.com/watch?v=kOkQ4T5WO9E";
列表.添加(b);
e、 按钮=list.ToArray();
msg.ChannelData=e;
msg.Text=“测试”;
但它抛出了一个错误。在bot框架中,仪表板无法看到问题。 如何调试这个

看一下视频。它向您展示了如何利用Facebook Messenger扩展在您的Bot框架chatbot中提供Webview体验


视频的演示代码是。

这是离题的。是否可以为此创建一些模板?为了避免每次都写所有东西?是的,您可以创建类,将它们放在不同的程序集中,并在项目中引用该程序集。可能重复