Develop
2013.04.23 17:35
[c#] Hashtable <-> Json (dll 포함)
조회 수 80713 댓글 0
첨부 '1' |
---|
# 샘플코드
using System.Net.Json; public string ConvertHashtableToJson(Hashtable data) { JsonObjectCollection result = new JsonObjectCollection(); foreach(DictionaryEntry item in data) { result.Add(new JsonStringValue(item.Key.ToString(), item.Value.ToString())); } return result.ToString(); } public Hashtable ConvertJsonToHashtable(string json) { JsonTextParser parse = new JsonTextParser(); JsonObject object = parse.Parse(json); Hashtable result = new Hashtable(); foreach(JsonObject item in obj as JsonObjectCollection) { result.add(item.Name, item.GetValue().ToString()); } }
[참고] http://bit.ly/hYMCLL (여기와 같은 dll을 업로드 함.)
번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|---|
9 | System/OS | 개인적으로 쓰고 있는 zshrc 파일 | hooni | 2022.02.25 | 985 |
8 | System/OS | 맥에서 포트 확인하고 닫기 (mac) | hooni | 2022.03.22 | 1179 |
7 | Develop | [ios] Pod 특정 버전 설치하고 사용하기 | hooni | 2022.05.28 | 1736 |
6 | Develop | [ios] 여러 버전의 Xcode 사용하기 | hooni | 2022.05.28 | 815 |
5 | System/OS | [macos] How to Fix ‘You Shut Down Your Computer Because of a Problem’ | hooni | 2022.06.01 | 922 |
4 | System/OS | 네트워크 용어 정리 | hooni | 2022.11.20 | 1551 |
3 | Develop | [swift] UIView에서 subview 찾기 | hooni | 2022.12.09 | 1999 |
2 | Etc | 영어. 반드시 외워야 할 문장 패턴 100개 | hooni | 2023.06.08 | 1341 |
1 | Etc | 원어민이 매일 쓰는 일상표현 150개 | hooni | 2023.09.17 | 1303 |