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을 업로드 함.)
-
[unix] 로그파일 정리 쉘스크립트
-
[c] 64bit 머신에서 inet_ntoa() 사용시 Segment fault 대처 방법법
-
[js] 웹페이지에서 특정 엘리먼트 드래그, 복사, 컨텍스트메뉴, 키보드 막기
-
[ios] Random Thoughts: Rand() vs. arc4random()
-
[ios] UIAlertView 초간단 샘플 ㅎㅎ
-
[ios] UIView에서 상위 UIViewController 가져오기
-
[ios] 소소한 팁 (Rect,Point,Path,URL 등)
-
[C#] MD5, SHA1 해시 & 인코딩
-
[c#] 웹문서 소스(html) 긁어오기
-
[android] 만화 어플 소스코드
-
[ios] 미스터피자(Mr.pizza) 어플
-
[iphone] 아이폰 어플 모음 ㅋㅋ