EvilZone

Programming and Scripting => .NET Framework => Topic started by: xor on May 19, 2015, 02:14:40 AM

Title: [C#] JSON to ExpandoObject from Web URL
Post by: xor on May 19, 2015, 02:14:40 AM

Code: [Select]
        public static dynamic GetJson(string url)
        {
            dynamic s;
            using (var client = new WebClient())
            {
                var json = client.DownloadString(url);
                s = JsonConvert.DeserializeObject<ExpandoObject>(json);
            }


            return s;
        }
Title: Re: [C#] JSON to ExpandoObject from Web URL
Post by: Xires on May 21, 2015, 12:04:05 PM
Linq is thoroughly confused by embedding this into statements.  It's rather humorous.  Excellent submission, though.  Thanks much.  It's sad to see your nick with so few cookies so have a couple extra. ;-P