Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }