如何在C#中将属性或变量名声明为fg+
?
public string fg+ { get; set; }
在JSON as "fg+": "103308076644479658279"
的响应中,我得到fg+
作为一个字段.
我正在使用一个类对其进行反序列化.如何从JSON中读取它?
如何在C#中将属性或变量名声明为fg+
?
public string fg+ { get; set; }
在JSON as "fg+": "103308076644479658279"
的响应中,我得到fg+
作为一个字段.
我正在使用一个类对其进行反序列化.如何从JSON中读取它?
Such a variable name isn't legal in C#.
If you're using Json.NET to deserialize your data, you can use the JsonProperty
attribute to give it a custom name:
[JsonProperty("fg+")]
public string Fg { get; set; }