Hızlı yanıt: kod örneği
stackoverflow.com how-to-list-all-minecraft-profiles
While useful in many cases, json2csharp.com is not foolproof. As you've seen, it does not handle cases where key names are dynamic or otherwise cannot be converted into valid C# identifiers. In these cases you will need to make manual adjustments to the generated classes. For example, you can use a in place of a static class to handle the dynamic keys of the object.Define your classes like this:You can then deserialize into the class using either or Json.Net, whichever you prefer.Here is a fiddle using Json.Net: https://dotnetfiddle.net/ZlEK63
Dictionary<string, Profile>
profiles
public class RootObject{ public Dictionary<string, Profile> profiles { get; set; } public string selectedProfile { get; set; }}public class Profile{ public string name { get; set; } public string lastVersionId { get; set; }}
RootObject
JavaScriptSerializer