JSON 예제 파일 내용

{ Unit : { Name : Jaeho, Age : 20 }, Temp : 111 }

 

 

public string GetString(string key,string jsonResult){
    try

{


   JSONObject jsonObj = JSONObject.Parse(jsonResult);  
   return jsonObj.GetString(key);   


  }catch(Exception e){
    return "";
  }
 }
 public JSONObject GetObject(string key,string jsonResult){
  try{
   JSONObject jsonObj = JSONObject.Parse(jsonResult);  
   return (JSONObject)jsonObj.GetObject(key);
  }catch(Exception e){
      return null;
  }
 }
 

 

JSONObject jsonObj = JSONObject.Parse(jsonResult);
  
   return jsonObj.GetString(key);   

 

JSONObject szUnit = WemeManager.getObject("Unit", szAuthData);
string szName = WemeManager.getString("Name", szUnit .ToString());

 

Posted by 부우산사나이
: