Contents

Develop
2013.04.23 17:35

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

조회 수 80655 댓글 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. [erp] SAP 모듈 요약

    Date2013.04.23 CategoryDevelop Byhooni Views15287
    Read More
  2. 최근 논문 자료 (2011/01/03, 만현형한테 보낸거..)

    Date2013.04.23 CategoryDevelop Byhooni Views10366
    Read More
  3. 논문에 들어갈 툴바 테스트 해볼 것..

    Date2013.04.23 CategoryDevelop Byhooni Views8013
    Read More
  4. [c#]뉴 툴바 개인적으로 만든거.. (old)

    Date2013.04.23 CategoryDevelop Byhooni Views4272
    Read More
  5. [c#]뉴 툴바 개인적으로 만든거.. (new)

    Date2013.04.23 CategoryDevelop Byhooni Views7724
    Read More
  6. [c#]업글 뉴 툴바 개인적으로 만든거.. (new) ㅋㅋ

    Date2013.04.23 CategoryDevelop Byhooni Views7651
    Read More
  7. [c#] 비동기 통신 샘플 코드 ㅎㅎ

    Date2013.04.23 CategoryDevelop Byhooni Views23637
    Read More
  8. [c#] 간단한 소켓통신 예제..

    Date2013.04.23 CategoryDevelop Byhooni Views26694
    Read More
  9. [c#] 간단한 IPC 통신 예제

    Date2013.04.23 CategoryDevelop Byhooni Views63733
    Read More
  10. [c#] Json 라이브러리 (System.Net.Json.dll)

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

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

    Date2013.04.23 CategoryDevelop Byhooni Views71973
    Read More
Board Pagination Prev 1 ... 52 53 54 55 56 57 58 59 60 61 ... 98 Next
/ 98