How can I get the dictionary value by key on function
my function code is this ( and the command what I try but didn\'t work ):
static void XML_Array
I use a similar method to dasblinkenlight's in a function to return a single key value from a Cookie containing a JSON array loaded into a Dictionary as follows:
///
/// Gets a single key Value from a Json filled cookie with 'cookiename','key'
///
public static string GetSpecialCookieKeyVal(string _CookieName, string _key)
{
//CALL COOKIE VALUES INTO DICTIONARY
Dictionary dictCookie =
JsonConvert.DeserializeObject>
(MyCookinator.Get(_CookieName));
string value;
if (dictCookie.TryGetValue( _key, out value))
{
return value;
}
else
{
return "0";
}
}
Where "MyCookinator.Get()" is another simple Cookie function getting an http cookie overall value.