Contents

Develop
2013.04.23 17:35

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

조회 수 80727 댓글 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#] Hashtable <-> Json (dll 포함)

    Date2013.04.23 CategoryDevelop Byhooni Views80727
    Read More
  2. [C#] MD5, SHA1 해시 & 인코딩

    Date2013.04.23 CategoryDevelop Byhooni Views77963
    Read More
  3. [c#] 웹문서 소스(html) 긁어오기

    Date2013.04.23 CategoryDevelop Byhooni Views24568
    Read More
  4. [c] 64bit 머신에서 inet_ntoa() 사용시 Segment fault 대처 방법법

    Date2014.02.08 CategoryDevelop Byhooni Views14262
    Read More
  5. [c] Mac OS 에 gmp(gmp.h) 라이브러리 설치

    Date2016.10.03 CategoryDevelop Byhooni Views1443
    Read More
  6. [c] 메시지큐(Message Queue) 설명.. (joinc)

    Date2013.04.23 CategoryDevelop Byhooni Views14302
    Read More
  7. [c] 프로세스 검사하기

    Date2013.04.23 CategoryDevelop Byhooni Views8048
    Read More
  8. [ios] Did UIScrollView End Scrolling?

    Date2016.04.19 CategoryDevelop Byhooni Views1173
    Read More
  9. [ios] Facebook Cache 갱신하는 함수

    Date2017.02.27 CategoryDevelop Byhooni Views1328
    Read More
  10. [ios] Facebook SDK 로그인 설명

    Date2017.04.19 CategoryDevelop Byhooni Views1356
    Read More
  11. [ios] FlckrFeed Example App (Swift)

    Date2016.11.27 CategoryDevelop Byhooni Views1207
    Read More
  12. [ios] iOS 4.0 beta 에서 3.1.3으로 다운그레이드 하는 법

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