3초기억력

asp에서 json 파일 호출하여 파싱. 테이블로 보여주기 본문

플밍_ASP

asp에서 json 파일 호출하여 파싱. 테이블로 보여주기

잠수콩 2014. 8. 5. 21:44
336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.



제목 :  asp에서 json 파일 호출하여 파싱. 테이블로 보여주기


소스 :

 

Dim url : url = "http://localhost:9011/json_test/order.asp"
Dim param : param = ""
Dim objHttp
Dim strJsonText

Set objHttp = server.CreateObject("Microsoft.XMLHTTP")
If IsNull(objHttp) Then
 Response.Write "서버 연결 오류. 관리자 문의바랍니다."
 Response.End
End If
objHttp.Open "Get", url, False
objHttp.SetRequestHeader "Content-Type","text/plain"
objHttp.Send param

strJsonText = objHttp.responseText ' 결과데이터 파서로 넘기기 위해 별도 저장

Set objHttp = Nothing '개체 소멸
'-------------------------------------------
Dim cheering: Set cheering = JSON.parse(strJsonText)
Dim rList

If IsNull(cheering) then
 Response.Write "Json Parsing Error<br/>"
 Response.End
End If


내용 : 원격 url 의 json 내용을 Microsoft.XMLHTTP 로 내용을 가져와서, 파싱하여 보여주기.

 

압축파일 내용

json 예제 파일.

파싱 파일.

JSON2.min.asp 파일



예제 소스 파일 :asp_json_sample.zip


 출처 :  직접 생산 ^^;;


'플밍_ASP' 카테고리의 다른 글

ASP SHA256 암호화  (0) 2015.03.17
asp 자동검색어 - ajax  (0) 2015.03.05
asp - LDAP 사용하여 인증하기 방법  (0) 2014.06.12
ServerXMLHTTP 사용법 + getOption Method  (0) 2014.04.10
ADO DataType 목록  (0) 2013.01.30
Comments