„Funktions/Json_Parse_Example.cs“ ändern
This commit is contained in:
parent
f1e63c40f2
commit
d2a91553b8
|
@ -13,8 +13,16 @@ class JsonParser
|
||||||
// Get Data
|
// Get Data
|
||||||
dynamic get_jsonData(string url)
|
dynamic get_jsonData(string url)
|
||||||
{
|
{
|
||||||
|
string json = "";
|
||||||
var webclient = new WebClient();
|
var webclient = new WebClient();
|
||||||
string json = webclient.DownloadString(url);
|
try
|
||||||
|
{
|
||||||
|
json = webclient.DownloadString(url);
|
||||||
|
}
|
||||||
|
catch(WebException e)
|
||||||
|
{
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
dynamic dynJson = JsonConvert.DeserializeObject(json);
|
dynamic dynJson = JsonConvert.DeserializeObject(json);
|
||||||
return dynJson;
|
return dynJson;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user