반응형
Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
Tags
- 정보처리기사필기
- 자바
- sklearn
- APPEND
- regressor
- BeautifulSoup
- 웹앱
- crawling
- 백준
- dataframe
- 머신러닝
- 비전공자
- BS
- java
- 크롤링
- Intellij
- ensemble
- SOUP
- 정보처리기사
- 정처기
- Req
- javascript
- pandas
- AWS
- lombok
- pds
- 자바스크립트
- request
- springboot
- list
Archives
- Today
- Total
No sweet without sweat
[C#] - JSON파싱한 값 가져오는 법 본문
728x90
반응형
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
// JSON 문자열 예시
string json = "{\"ColumnName1\": \"Value1\", \"ColumnName2\": \"Value2\"}";
// JSON 문자열을 객체로 파싱
var data = JsonConvert.DeserializeObject<Dictionary<string, string>>(json);
// 필요한 값을 가져오기
if (data.ContainsKey("ColumnName1"))
{
string value1 = data["ColumnName1"];
Console.WriteLine("Value1: " + value1);
}
if (data.ContainsKey("ColumnName2"))
{
string value2 = data["ColumnName2"];
Console.WriteLine("Value2: " + value2);
}
728x90
반응형
'C#' 카테고리의 다른 글
[C#] - 콤보박스 셋팅 (1) | 2023.11.18 |
---|---|
[C#] - 문자인지 숫자인지 파악하는 법 (1) | 2023.11.18 |
Comments