Contents

Develop
2013.04.23 17:35

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

조회 수 80721 댓글 0
Atachment
첨부 '1'
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
# 샘플코드
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. [c] 메시지큐(Message Queue) 설명.. (joinc)

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

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

  4. [json] 종결자 (설명과 웹, C/C++/C# 프로그램 샘플 코드)

  5. [lego] 세그웨이 이것만 볼것.. ㅎㅎ

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

  7. [iphone] 아이폰 어플 모음 ㅋㅋ

  8. [ios] 미스터피자(Mr.pizza) 어플

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

  10. [sql] insert into select 사용하기

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

  12. 디피헬만(Diffie-Hellman) 초간단 개념..

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