How to Split The Token (Only) In asp.net?
this my Requirement:
-------------------------
{"meta":
{
"code":"AH000",
"description":"Success",
"status":0
},
"data":{
"token":"MjQzMjYxMjQzMTMyMjQ0ZDRkNTIzMDc5NjY2ODU1NzQ2NDU4NDk3MzcyNzY1OTRhNjE2YTQyNzg2NTY5NTk2Yjc1NTY0YzM3NTI1OT",
"tokenType":"SESSION",
"expiresIn":86400
}
}
Tuhin PaulPosted May 4, 2023, 12:17 PM
To split the token in ASP.NET, you can use the `Newtonsoft.Json` package to deserialize the JSON string into a C# object and then access the `token` property.
We are first parsing the JSON string into a `JObject` using the `JObject.Parse` method. We can then access the `token` property by indexing into the object using the property name as a key. The resulting `token` variable will contain the value of the `token` property, which in this case is the long string of characters.
Rajkiran SwainPosted May 4, 2023, 11:40 AM