JSON.GetField C# (CSharp) Méthode

GetField() public méthode

public GetField ( string name ) : JSON,
name string
Résultat JSON,
	public JSON GetField(string name) {
		if(type == JSON.Type.OBJECT)
			for(int i = 0; i < keys.Count; i++)
				if((string)keys[i] == name)
					return (JSON)list[i];
		return null;
	}

Usage Example

Exemple #1
0
 // Callback
 static void OnLoginByName(JSON result)
 {
     try
     {
         Crown.instance.userId   = result.GetField("userId").str;
         Crown.instance.userKey  = result.GetField("userKey").str;
         Crown.instance.userSpot = result.GetField("spot").str;
     }
     catch
     {
         Crown.Error("Login error, data not found");
     }
 }
All Usage Examples Of JSON::GetField