using System; using System.Threading.Tasks; using System.Net.Http; using System.Net.Http.Headers; using System.IO; using System.Collections.Generic; using Gallery; namespace rhentai{ // Program class class Program{ // Creating a HttpClient private static readonly HttpClient client = new HttpClient(); // Main function static async Task Main(string[] args){ // Get Result from HttpGetGallery string HttpGalleryString = await HttpGetGallery(); var Tags = new List(); Tags = new Gallery.Gallery(HttpGalleryString).Tags; int ID = new Gallery.Gallery(HttpGalleryString).GalleryId; foreach (var Tag in Tags) { Console.Write(Tag); } Console.WriteLine(ID); Console.WriteLine(); } // private static async Task HttpGetGallery(){ // Create Task client.DefaultRequestHeaders.Accept.Clear(); client.DefaultRequestHeaders.Accept.Add( new MediaTypeWithQualityHeaderValue("application/vnd.github.v3+json")); var stringTask = client.GetStringAsync("https://nhentai.net/random/"); // Return Task Result return (await stringTask).ToString(); } } }