Contents

Develop
2013.04.23 17:35

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

조회 수 84621 댓글 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] 컴파일러 DFA구현^^ 입력 받아 실행

    Date2003.04.23 CategoryDevelop Byhooni Views9977
    Read More
  2. [c] 캘린더 양음 변환 함수

    Date2003.04.23 CategoryDevelop Byhooni Views9605
    Read More
  3. [c] 최대공약수, 최소공배수, 서로소 구하기 (펌)

    Date2013.04.23 CategoryDevelop Byhooni Views12271
    Read More
  4. [c] 최대공약수 알고리즘 (유클릿)

    Date2003.04.23 CategoryDevelop Byhooni Views10351
    Read More
  5. [c] 최단거리 알고리즘 & 예제소스..

    Date2013.04.23 CategoryDevelop Byhooni Views12299
    Read More
  6. [c] 지폰(gphone) 소스.. 수정(암호화)

    Date2013.04.23 CategoryDevelop Byhooni Views8292
    Read More
  7. [c] 지나가는 패킷 잡기

    Date2003.04.23 CategoryDevelop Byhooni Views9774
    Read More
  8. [c] 정수를 2진수로 변환 (재귀,비트연산)

    Date2003.04.23 CategoryDevelop Byhooni Views8791
    Read More
  9. [c] 정사각배열의 서브 배열의 최대 값 구하기

    Date2003.04.23 CategoryDevelop Byhooni Views8651
    Read More
  10. [c] 전위 표기법으로 연산 예제..

    Date2013.04.23 CategoryDevelop Byhooni Views10404
    Read More
  11. [c] 재미있는 코딩..

    Date2003.04.23 CategoryDevelop Byhooni Views23275
    Read More
  12. [c] 자료구조 그래프(graph) 소스코드 - 확인해볼 것..

    Date2013.04.23 CategoryDevelop Byhooni Views9513
    Read More
Board Pagination Prev 1 ... 62 63 64 65 66 67 68 69 70 71 ... 99 Next
/ 99