есть
string text = "{\"phone\":\"995555303481\",\"message\":{\"successful\":true,\"code\":0,\"errorText\":\"\",\"response\":0}}";
как вырезать отсюда номер 995555303481
есть
string text = "{\"phone\":\"995555303481\",\"message\":{\"successful\":true,\"code\":0,\"errorText\":\"\",\"response\":0}}";
как вырезать отсюда номер 995555303481
Как сериализировать и десериализировать JSON в .NET
using System.Text.Json;
public class Response
{
public string Phone { get; set; }
}
var options = new JsonSerializerOptions { PropertyNameCaseInsensitive = true };
string phone = JsonSerializer.Deserealize<Response>(text, options).Phone;