private void Window_Loaded(object sender, RoutedEventArgs e) { Information information = Information.GetInstace(); var consumerkey = information.stkey; var userid = information.stid; var api = new SteamApi(consumerkey, userid); DetailsInformation detailsInformation = DetailsInformation.GetInstace(); var steamapi = api.GetGameUserInformation(); array = new string[steamapi.response.game_count, 2]; for (int i = 0; i < steamapi.response.game_count; i++) { array[i, 0] = steamapi.response.games[i].appid.ToString(); array[i, 1] = steamapi.response.games[i].name; var hashUrl = api.HashUrl(steamapi.response.games[i].img_icon_url , steamapi.response.games[i].appid.ToString()); BitmapImage imageSource = new BitmapImage(new Uri(hashUrl)); listView.Items.Add(new ManagedItem { Picture = imageSource, Name = steamapi.response.games[i].name.ToString() , PlayTime = steamapi.response.games[i].playtime_forever / 60 + "時間" }); } }
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; }
private void btSer_Click(object sender, RoutedEventArgs e) { Information information = Information.GetInstace(); var consumerkey = information.stkey; var userid = information.stid; var api = new SteamApi(consumerkey, userid); appidArray = new string[30]; nameArray = new string[30]; var list = api.GetGameList(); var count = 0; listView.Items.Clear(); try { for (int i = 0; i < list.applist.apps.Count(); i++) { if (list.applist.apps[i].name.IndexOf(tbTitle.Text, StringComparison.OrdinalIgnoreCase) >= 0) { var review = api.GetReviewInfo(list.applist.apps[i].appid.ToString()); //var str = list.applist.apps[i].name; BitmapImage imageSource = new BitmapImage(new Uri("https://steamcdn-a.akamaihd.net/steam/apps/" + list.applist.apps[i].appid.ToString() + "/header.jpg")); imageSource.DecodePixelWidth = 100; listView.Items.Add(new ImageItem { Picture = imageSource, Name = list.applist.apps[i].name, Other = review.query_summary.review_score_desc, appid = list.applist.apps[i].appid.ToString() }); appidArray[count] = list.applist.apps[i].appid.ToString(); nameArray[count] = list.applist.apps[i].name; count += 1; if (count >= 20) { break; } } } } catch (Exception ex) { MessageBox.Show("不正な操作", ex.Message); } }