// 导入必要的命名空间 using AdaptiveCards; using Newtonsoft.Json;
// 定义AdaptiveCard JSON字符串 string cardJson = @"{ ""$schema"": ""http://adaptivecards.io/schemas/adaptive-card.json"", ""type"": ""AdaptiveCard"", ""version"": ""1.0"", ""body"": [ { ""type"": ""TextBlock"", ""text"": ""Hello, World!"" } ] }";
// 使用Newtonsoft.Json进行解析
var result = JsonConvert.DeserializeObject
// 检查解析结果是否为null if (result == null) { throw new Exception("AdaptiveCards解析错误!"); }