JObject의 key 값을 추출하는 방법
- 📕 Programing/C#
- 2024. 9. 30. 16:26
- JObject의 key 값을 얻기 위해서는 Dictionary로 바꿔주는 작업을 해야 된다.
JObject를 Dictionary로 바꾸는 방법
JObject jsonObj = JObject.Parse(jsonString);
Dictionary<string, string> dictObj = jsonObj.ToObject<Dictionary<string, string>>();
1. Dictionary의 Key 추출 방법
//key추출
foreach(String key in dicObj.Keys)
{
Console.WriteLine("key :: " + key);
}
'📕 Programing > C#' 카테고리의 다른 글
WinForm) ControlBox (0) | 2024.10.27 |
---|---|
MaterialSkin 적용 방법 (0) | 2024.08.20 |
Newtonsoft.Json (C#에서 Json활용법) (0) | 2024.08.08 |