------------------------------------------1st Methods-----------------------------------------------------------------
File Name: json.txt
{"processing_result":"1","error_message_string":"{\r\n \"dob\": \"02/04/1999\",\r\n \"mobile\": \"9788888888\",\r\n \"City\": \"Mumbai\",
\r\n \"company\": \"KOTAK MAHINDRA BANK LIMITED\",\r\n \"company_category\": \"OTHER SUPER CAT A\",\r\n \"official_email_id\": \"sdfsdfs@asdas.com\",
\r\n \"salary\": \"74000\",\r\n \"lead_id\": \"1073227\",\r\n \"oppo_id\": \"153471\",\r\n \"loan_application_id\": \"042420171535_4215\",
\r\n \"loan_amount\": \"244000\",\r\n \"customer_status\": \"FINALSUBMITDONE\",\r\n \"cibil_score\": \"-1\",\r\n \"applied_date\": \"24/04/2017\",
\r\n \"lead_source\": \"test\",\r\n \"product\": \"Personal Loans\",\r\n \"previous_month_salary\": \"74000\",\r\n \"salaried_sep_senp\": \"0\",
\r\n \"total_employment\": \"0\",\r\n \"tenure\": \"32\",\r\n \"processing_fee\": \"999\",\r\n \"roi\": \"11.99\",\r\n \"emi_options\": \"STD\"\r\n}",
"timestamp":"2017-04-24 03.41 PM"}
string result= File.ReadAllText(Server.MapPath("json\\json.txt"));
JObject joResponse = JObject.Parse(result);
string Status= joResponse["result"].ToString();
JObject error_message_string = JObject.Parse(joResponse["result"].ToString());
string RejectionReason = Convert.ToString(error_message_string["innerresult"].ToString());
-----------------------------------------2nd Methods-----------------------------------------------------------------
File Name: djson.txt file
{"ExtDResponse":{"API":{"Status":"SUCCESS","Remarks":"","LogTxnId":299018},"FanNo":"279PZ0000084",
"ExtDApplicants":{"ExtDApplicant":{"ExtDAppDetails":{"ApplicantReferenceId":"PL_021320171916_6683","ApplicantType":"P"},
"ExtDDetails":{"DReferenceId":10284,"TypeOfMatch":"","OverallResult":"004"},
"ExtDMatches":{"ExtDMatch":{"ChasisNo":"","DD":"","BookedDate":"","IdDrivingLic":"",
"ReportDate":"","OdcSett":"","IdPanCard":"","Reason":"","ApplFlag":"","MatchDesc":"","RcNo":"",
"ContractNo":"","PhoneNo":"","EngineNo":"","Status":"","MobileNo":"","IdPassport":"","FirstName":"",
"PinCodeNo":"","ContractId":"","City":"","ValWaiver":"","MiddleName":"","IdElectionCard":"","AddressLine3":"",
"AddressLine2":"","AddressLine1":"","DealerCode":"","Model":"","LastName":"","BranchCode":"","BirthDate":""}}}}}}
string result = File.ReadAllText(Server.MapPath("\\test\\json\\Dsjson.txt"));
var parsed = JObject.Parse(result);
string Status = parsed.SelectToken("ExtDResponse.API.Status").Value<string>();
string FanNo = parsed.SelectToken("ExtDResponse.FanNo").Value<string>();
string OverallResult = parsed.SelectToken("ExtDResponse.ExtDApplicants.ExtDApplicant.ExtDDetails.OverallResult").Value<string>();
string DDDReferenceId = parsed.SelectToken("ExtDResponse.ExtDApplicants.ExtDApplicant.ExtDDetails.DReferenceId").Value<string>();
string ApplicantReferenceId = parsed.SelectToken("ExtDResponse.ExtDApplicants.ExtDApplicant.ExtDAppDetails.ApplicantReferenceId").Value<string>();
string ContractId = parsed.SelectToken("ExtDResponse.ExtDApplicants.ExtDApplicant.ExtDMatches.ExtDMatch.ContractId").Value<string>();
string PinCodeNo = parsed.SelectToken("ExtDResponse.ExtDApplicants.ExtDApplicant.ExtDMatches.ExtDMatch.PinCodeNo").Value<string>();
string MatchDesc = parsed.SelectToken("ExtDResponse.ExtDApplicants.ExtDApplicant.ExtDMatches.ExtDMatch.MatchDesc").Value<string>();
string Model = parsed.SelectToken("ExtDResponse.ExtDApplicants.ExtDApplicant.ExtDMatches.ExtDMatch.Model").Value<string>();
string RcNo = parsed.SelectToken("ExtDResponse.ExtDApplicants.ExtDApplicant.ExtDMatches.ExtDMatch.RcNo").Value<string>();
string ApplFlag = parsed.SelectToken("ExtDResponse.ExtDApplicants.ExtDApplicant.ExtDMatches.ExtDMatch.ApplFlag").Value<string>();
string BranchCode = parsed.SelectToken("ExtDResponse.ExtDApplicants.ExtDApplicant.ExtDMatches.ExtDMatch.BranchCode").Value<string>();
string IdPanCard = parsed.SelectToken("ExtDResponse.ExtDApplicants.ExtDApplicant.ExtDMatches.ExtDMatch.IdPanCard").Value<string>();
string OdcSett = parsed.SelectToken("ExtDResponse.ExtDApplicants.ExtDApplicant.ExtDMatches.ExtDMatch.OdcSett").Value<string>();
string LastName = parsed.SelectToken("ExtDResponse.ExtDApplicants.ExtDApplicant.ExtDMatches.ExtDMatch.LastName").Value<string>();
string MobileNo = parsed.SelectToken("ExtDResponse.ExtDApplicants.ExtDApplicant.ExtDMatches.ExtDMatch.MobileNo").Value<string>();
string BookedDate = parsed.SelectToken("ExtDResponse.ExtDApplicants.ExtDApplicant.ExtDMatches.ExtDMatch.BookedDate").Value<string>();
string ReportDate = parsed.SelectToken("ExtDResponse.ExtDApplicants.ExtDApplicant.ExtDMatches.ExtDMatch.ReportDate").Value<string>();
string DD = parsed.SelectToken("ExtDResponse.ExtDApplicants.ExtDApplicant.ExtDMatches.ExtDMatch.DD").Value<string>();
string FirstName = parsed.SelectToken("ExtDResponse.ExtDApplicants.ExtDApplicant.ExtDMatches.ExtDMatch.FirstName").Value<string>();
string Reason = parsed.SelectToken("ExtDResponse.ExtDApplicants.ExtDApplicant.ExtDMatches.ExtDMatch.Reason").Value<string>();
string IdElectionCard = parsed.SelectToken("ExtDResponse.ExtDApplicants.ExtDApplicant.ExtDMatches.ExtDMatch.IdElectionCard").Value<string>();
string DealerCode = parsed.SelectToken("ExtDResponse.ExtDApplicants.ExtDApplicant.ExtDMatches.ExtDMatch.DealerCode").Value<string>();
string BirthDate = parsed.SelectToken("ExtDResponse.ExtDApplicants.ExtDApplicant.ExtDMatches.ExtDMatch.BirthDate").Value<string>();
string City = parsed.SelectToken("ExtDResponse.ExtDApplicants.ExtDApplicant.ExtDMatches.ExtDMatch.City").Value<string>();
string inStatus = parsed.SelectToken("ExtDResponse.ExtDApplicants.ExtDApplicant.ExtDMatches.ExtDMatch.Status").Value<string>();
string MiddleName = parsed.SelectToken("ExtDResponse.ExtDApplicants.ExtDApplicant.ExtDMatches.ExtDMatch.MiddleName").Value<string>();
string ValWaiver = parsed.SelectToken("ExtDResponse.ExtDApplicants.ExtDApplicant.ExtDMatches.ExtDMatch.ValWaiver").Value<string>();
string AddressLine1 = parsed.SelectToken("ExtDResponse.ExtDApplicants.ExtDApplicant.ExtDMatches.ExtDMatch.AddressLine1").Value<string>();
string AddressLine2 = parsed.SelectToken("ExtDResponse.ExtDApplicants.ExtDApplicant.ExtDMatches.ExtDMatch.AddressLine2").Value<string>();
string AddressLine3 = parsed.SelectToken("ExtDResponse.ExtDApplicants.ExtDApplicant.ExtDMatches.ExtDMatch.AddressLine3").Value<string>();