我工作在UWP應用解析JSON數據返回,這是目前我的工作代碼:顯示JSON的一部分從數據庫中UWP
public sealed partial class MainPage : Page
{
public MainPage()
{
this.InitializeComponent();
}
private async void Button_Click(object sender, RoutedEventArgs e)
{
String MyGetRequest = await GetRequest();
ResultTextBlock.Text = MyGetRequest.ToString() + " - ";
}
public static async Task<String> GetRequest()
{
Uri geturi = new Uri("url"); //replace your url
System.Net.Http.HttpClient client = new System.Net.Http.HttpClient();
System.Net.Http.HttpResponseMessage responseGet = await client.GetAsync(geturi);
string response = await responseGet.Content.ReadAsStringAsync();
return response;
}
現在我想要做的就是顯示器在這種情況下返回其數值之一的數據:用戶名,我不需要顯示從數據庫中檢索的其餘信息。如果任何人都可以指出我正確的方向,將不勝感激。
凡功能你解析JSON嗎? – aloisdg