{"CategoryID":"1","CountryID":"1","CountryName":"United Arab Emirates",
"BillerID":"23","AccountNo":"1234567890",
"Authenticators":"{\"ConsumerNumber\":\"1234567890\",\"LastBillDate\":\"14-10-2014\",\"LastBillDueDate\":\"24-11-2014\"}",
"ShortName":"0000000001"}
내가
UserContext obj1 = Deserialize<UserContext>(context);
으로 C#에서 각 요소의 값을 얻을 수 있습니다
[Serializable]
public class UserContext
{
public string CategoryID { get; set; }
public string BillerID { get; set; }
public string AccountNo { get; set; }
public string Authenticators { get; set; }
public string ShortName { get; set; }
public string CountryID { get; set; }
public string CountryName { get; set; }
}
와 유사한 C# 클래스를 가지고 자바 스크립트에서 JSON 개체가
그러나 Authenticators
은 json 객체를 중첩합니다.이 같은 것이 필요합니다. C#
[Serializable]
public class Authenticators
{
public string ConsumerNumber { get; set; }
public string LastBillDate { get; set; }
public string LastBillDueDate { get; set; }
}
그래서 내가
string value = obj.ConsumerNumber;
처럼 각 Authenticators
요소의 각 값을 얻을 수 있다는 것을 나는 값으로 두 개의 클래스를 채우려. 어떻게하면 같은 결과를 얻을 수 있습니까?
Y downvote ...? – Shaggy