public static async Task <Rootobject> GetImageInfoFromAPI(string imageURL) { Rootobject rootobject = new Rootobject(); Imageinfo imginfo = new Imageinfo(); HttpClient http = new HttpClient(); var response = await http.GetAsync(imageURL); var result = await response.Content.ReadAsStringAsync(); var data = JsonConvert.DeserializeObject <Rootobject>(result); return(data); }
public static string Imginfo(this Imageinfo info) { var file = Program.FILE_Path; string result = string.Empty; switch (info) { case Imageinfo.Extension: result = Path.GetExtension(file).ToLower(); break; case Imageinfo.FileName: result = Path.GetFileNameWithoutExtension(file); break; } return(result); }