从网址下载json文件

时间:2019-05-31 09:53:26

标签: c# json url

我正在尝试从服务器下载文件(Json),但是由于某些原因,我的代码无法正常工作。 有人可以帮我吗?

        Cursor.Current = Cursors.WaitCursor;
        TextDaten tx = new TextDaten();
        List<string> lines = File.ReadAllLines(Properties.Settings.Default.coutrieslist).ToList();


        try
        {
            foreach(DataGridViewRow row in dataGridView1.Rows)
            {
                DataGridViewCheckBoxCell ch2 = (DataGridViewCheckBoxCell)row.Cells[0];

                if (ch2 == true) { }

                DataDownloading datadown = new DataDownloading();

                HttpClient client = new HttpClient();
                List<string> link = null;

                var countries = new List<string>() { "QNA/AUS" };
                HttpClient hc = new HttpClient();
                var x =  hc.GetAsync("https://stats.oecd.org/sdmx-json/data/QNA/AUS...");
                //var str = $"x{ x } hc{hc}";
            }
        }
        catch
        {
            MessageBox.Show("Error!");
        }

0 个答案:

没有答案