I am new to C#. I want to convert the two strings to single JSON array.
I tried the following:
var username = "username";
var password = "XXXXXXXX";
var json_data = "result":[{"username":username,"password":password}]'; //To convert the string to Json array i tried like this
MessageBox.Show(json_data);
It is not working, I'm getting a lot of errors.
I've went through the following links:
http://www.codeproject.com/Articles/272335/JSON-Serialization-and-Deserialization-in-ASP-NET
To learn how to convert my string to Json array. Well explained in the above url, but for my case I don't know how to convert this two string to single Json array.
I want the output to be like this format,
[{"result":{"username":"Tom","password":"XXXXXXX"}}]
Please help me in doing this.