Contents

Develop
2013.04.23 17:35

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

조회 수 80713 댓글 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. [android] 안드로이드 어플 모음 ㅎㅎ

    Date2013.04.23 CategoryDevelop Byhooni Views16340
    Read More
  2. [lego] 세그웨이 이것만 볼것.. ㅎㅎ

    Date2013.04.23 CategoryDevelop Byhooni Views33572
    Read More
  3. [json] 종결자 (설명과 웹, C/C++/C# 프로그램 샘플 코드)

    Date2013.04.23 CategoryDevelop Byhooni Views72023
    Read More
  4. [c#] Hashtable <-> Json (dll 포함)

    Date2013.04.23 CategoryDevelop Byhooni Views80713
    Read More
  5. [android] 점심 해결 앱 소스 코드 ㅋㅋ

    Date2013.04.23 CategoryDevelop Byhooni Views76466
    Read More
  6. [c] 메시지큐(Message Queue) 설명.. (joinc)

    Date2013.04.23 CategoryDevelop Byhooni Views14293
    Read More
  7. [ios] iOS 4.0 beta 에서 3.1.3으로 다운그레이드 하는 법

    Date2013.04.23 CategoryDevelop Byhooni Views37536
    Read More
  8. [ios] 아이폰용 앱 오픈 소스들

    Date2013.04.23 CategoryDevelop Byhooni Views468297
    Read More
  9. [android] 디바이스(시뮬레이터) hosts 파일 수정하기

    Date2013.04.23 CategoryDevelop Byhooni Views31113
    Read More
  10. [java] 입출력 스트림 3부 (오브젝트)

    Date2013.04.23 CategoryDevelop Byhooni Views17165
    Read More
  11. [java] 입출력 스트림 1부 (문자)

    Date2013.04.23 CategoryDevelop Byhooni Views15328
    Read More
  12. [android] Canvas를 이용해 이미지 확대/축소 하기

    Date2013.04.23 CategoryDevelop Byhooni Views60786
    Read More
Board Pagination Prev 1 2 3 4 5 6 Next
/ 6