【发布时间】:2017-05-21 03:08:54
【问题描述】:
我正在尝试创建一个 json 字符串以通过 httprequest 发送,我有这样的 json 字符串:
{
"a-string": "123",
"another-string": "hello",
"another": "1"
}
我的问题是,如果我尝试像这样生成它
string json = new JavaScriptSerializer().Serialize(new
{
"a-string" = "123",
"another-string" = "hello",
"another" = "1"
});
那么有什么方法可以尝试执行上述操作而不会出现该错误?
【问题讨论】:
标签: c#