Contents

Develop
2013.04.23 17:35

[c#] Hashtable <-> Json (dll 포함)

Views 80733 Comment 0
Atachment
Attachment '1'
?

Shortcut

PrevPrev Article

NextNext Article

Larger Font Smaller Font Up Down Go comment Print
?

Shortcut

PrevPrev Article

NextNext Article

Larger Font Smaller Font Up Down Go comment Print
# 샘플코드
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을 업로드 함.)
TAG •

?

  1. [android] 만화 어플 소스코드

  2. [android] 안드로이드 어플 모음 ㅎㅎ

  3. [android] 점심 해결 앱 소스 코드 ㅋㅋ

  4. [android][ios] 알림(Notification) 기능에 대한 원리와 구현 방안 (APNS포함)

  5. [c#] Hashtable <-> Json (dll 포함)

  6. [C#] MD5, SHA1 해시 & 인코딩

  7. [c#] 웹문서 소스(html) 긁어오기

  8. [c] 64bit 머신에서 inet_ntoa() 사용시 Segment fault 대처 방법법

  9. [c] Mac OS 에 gmp(gmp.h) 라이브러리 설치

  10. [c] 메시지큐(Message Queue) 설명.. (joinc)

  11. [c] 프로세스 검사하기

  12. [ios] Did UIScrollView End Scrolling?

Board Pagination Prev 1 2 3 4 5 6 7 Next
/ 7