Skip to content

Instantly share code, notes, and snippets.

@zoolbia
Created October 17, 2017 03:43
Show Gist options
  • Save zoolbia/79d2ee3293f0873cafc08e4b0066c6bd to your computer and use it in GitHub Desktop.
Save zoolbia/79d2ee3293f0873cafc08e4b0066c6bd to your computer and use it in GitHub Desktop.
JavaScriptSerializer js = new JavaScriptSerializer();
try
{
string strData = "JSON data";
Dictionary<string, object> dic = js.Deserialize<Dictionary<string, object>>(strData);
}
catch (ArgumentException argE)
{
MessageBox.Show("JSON data is not valid", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment