示例#1
0
        private async void Laden(object sender, RoutedEventArgs e)
        {
            var url = $"https://www.googleapis.com/books/v1/volumes?q={suchTb.Text}";

            var web  = new HttpClient();
            var json = await web.GetStringAsync(url);

            BooksResult result = JsonConvert.DeserializeObject <BooksResult>(json);

            myGrid.ItemsSource = result.items.Select(x => x.volumeInfo).ToList();
        }
示例#2
0
        private async void button1_Click(object sender, EventArgs e)
        {
            var url = $"https://www.googleapis.com/books/v1/volumes?q={textBox1.Text}";

            var http = new HttpClient();

            string json = await http.GetStringAsync(url);

            BooksResult result = JsonConvert.DeserializeObject <BooksResult>(json);

            dataGridView1.DataSource = result.items.Select(x => x.volumeInfo).ToList();
        }