private void tbReg_Click(object sender, RoutedEventArgs e) { try { if (tbID.Text == "" || tbKey.Text == "") { MessageBox.Show("値が間違っています"); } else { var api = new SteamApi(tbKey.Text, tbID.Text); var steamapi = api.GetUserInformation(); if (steamapi.response.players[0].personaname == null) { MessageBox.Show("値が間違っています"); } else { Information information = Information.GetInstace(); information.UpdateStatus(tbKey.Text, tbID.Text); var win = new MainWindow(); win.Show(); Close(); } } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void Page_Loaded(object sender, RoutedEventArgs e) { Information information = Information.GetInstace(); var consumerkey = information.stkey; var userid = information.stid; var api = new SteamApi(consumerkey, userid); var steamapi = api.GetUserInformation(); tbSteamid.Text = steamapi.response.players[0].steamid; tbName.Text = steamapi.response.players[0].personaname; BitmapImage imageSource = new BitmapImage(new Uri(steamapi.response.players[0].avatarfull)); tbAvatar.Source = imageSource; }