簡體   English   中英

如何在 C# 中使用 HttpWebRequest 和 HttpWebResponse 從“https://www.scopus.com/author/highchart.uri?authorId=7103216110”Url 獲取 Json 值

[英]How to get Json value from "https://www.scopus.com/author/highchart.uri?authorId=7103216110" Url With HttpWebRequest and HttpWebResponse In C#

我正在使用 C# 處理 DesktopApplication,我想從此 url 讀取 json 值,以便反序列化 json 文件並將其數據插入到我的數據庫中,但我無法使用 StreamReader Class 讀取 json 值:

WebResponse response = request.GetResponse();
using (Stream responseStream = response2.GetResponseStream())
{
    StreamReader reader = new StreamReader(responseStream, Encoding.UTF8);
    jsonValue = reader.ReadToEnd();
}

請參考Newtonsoft.Json這個 NuGet 包可以做你需要的。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM