Develop
2013.04.23 17:35
[c#] Hashtable <-> Json (dll 포함)
조회 수 80727 댓글 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을 업로드 함.)
-
[c#] Hashtable <-> Json (dll 포함)
-
[C#] MD5, SHA1 해시 & 인코딩
-
[c#] 웹문서 소스(html) 긁어오기
-
[c] 64bit 머신에서 inet_ntoa() 사용시 Segment fault 대처 방법법
-
[c] Mac OS 에 gmp(gmp.h) 라이브러리 설치
-
[c] 메시지큐(Message Queue) 설명.. (joinc)
-
[c] 프로세스 검사하기
-
[ios] Did UIScrollView End Scrolling?
-
[ios] Facebook Cache 갱신하는 함수
-
[ios] Facebook SDK 로그인 설명
-
[ios] FlckrFeed Example App (Swift)
-
[ios] iOS 4.0 beta 에서 3.1.3으로 다운그레이드 하는 법