how to capture all games installed on my computer vb.net - otofocknk - Mar 30, 2019
how to capture all games installed on my computer vb.net
Print : http: //prntscr.com/n5belt
RE: how to capture all games installed on my computer vb.net - itcorp - Mar 31, 2019
(Mar 30, 2019 09:06 PM)otofocknk Wrote: how to capture all games installed on my computer vb.net
Print : http: //prntscr.com/n5belt
here's a quick solution,it's not a professional solution but it's enough to get some idea so that you can achieve the result what are you looking for. Again, i emphasize that you use this code as an idea not as a final solution because of poor quality.All the best
![[Image: hFDfLmz.png]](https://i.imgur.com/hFDfLmz.png)
Code public class GameInfo
{
public string GameName { get; set; }
public string GameCover { get; set; }
public string GamePath { get; set; }
public string GameLunchPath { get; set; }
}
public partial class MainWindow : Window
{
private List<GameInfo> myInstalledGames = new List<GameInfo>();
public MainWindow()
{
InitializeComponent();
}
public void ChekGames()
{
Dictionary<string,string> gamepath = new Dictionary<string, string>()
{
{"Windows","GameName1"},
{"Users","GameName2"},
{"Temp","GameName3"}
};
foreach(KeyValuePair<string,string> item in gamepath)
{
if(Directory.Exists($@"C:\{item.Key}"))
{
myInstalledGames.Add(GameData(item.Value));
}
}
}
public GameInfo GameData(string gamename)
{
Dictionary<string, GameInfo> gamepath = new Dictionary<string, GameInfo>()
{
{"GameName1",new GameInfo(){GameName="Game 1",GameCover="https://upload.wikimedia.org/wikipedia/en/d/db/Apex_legends_cover.jpg" } },
{"GameName2",new GameInfo(){GameName="Game 2",GameCover="https://www.mobygames.com/images/covers/l/33719-half-life-counter-strike-xbox-front-cover.jpg" }},
{"GameName3",new GameInfo(){GameName="Game 3",GameCover="https://upload.wikimedia.org/wikipedia/en/thumb/4/47/Tom_Clancy%27s_Rainbow_Six_Siege_cover_art.jpg/220px-Tom_Clancy%27s_Rainbow_Six_Siege_cover_art.jpg" }}
};
if (gamepath.ContainsKey(gamename) == true)
{
return gamepath[gamename];
}
else
return null;
}
private void Button_Click(object sender, RoutedEventArgs e)
{
myInstalledGames.Clear();
GameListConteiner.Children.Clear();
ChekGames();
}
private void load_Click(object sender, RoutedEventArgs e)
{
GameListConteiner.Children.Clear();
foreach(var item in myInstalledGames)
{
var gamecover = new GameCover();
gamecover.Height = 350;
gamecover.Width = 250;
gamecover.Margin = new Thickness(5);
gamecover.gameName.Text = item.GameName;
gamecover.imgGameCover.Source = new BitmapImage(new Uri(item.GameCover));
GameListConteiner.Children.Add(gamecover);
}
}
}
Main windows xaml
Code <Grid Background="#2d3436">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<WrapPanel x:Name="GameListConteiner">
</WrapPanel>
<StackPanel Grid.Column="1">
<Button Click="Button_Click" Content="Check " HorizontalAlignment="Left" VerticalAlignment="Top" Width="75"/>
<Button x:Name="load" Click="load_Click" Content="Load" HorizontalAlignment="Left" VerticalAlignment="Top" Width="75"/>
</StackPanel>
</Grid>
Game cover user control xaml
Code <UserControl x:Class="Games.GameCover"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Games"
mc:Ignorable="d"
d:DesignHeight="350" d:DesignWidth="250">
<Grid Background="#2f3640">
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="40" MaxHeight="40"/>
</Grid.RowDefinitions>
<Image Grid.Row="0" Height="350" Name="imgGameCover" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
<TextBlock x:Name="gameName" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="5" FontWeight="DemiBold" Foreground="White"/>
</Grid>
</UserControl>
RE: how to capture all games installed on my computer vb.net - gigajew - Apr 2, 2019
Basically keep an online and up-to-date list of games, and cross reference it with locally installed apps. You may have to iterate through the list of installed programs in the registry to get this. And you may have to write a custom function that can pull installed app id's from Steam and pull details from an online API that tells you what game title is what app id.
RE: how to capture all games installed on my computer vb.net - Dredd - Apr 3, 2019
(Apr 2, 2019 08:03 PM)gigajew Wrote: Basically keep an online and up-to-date list of games, and cross reference it with locally installed apps. You may have to iterate through the list of installed programs in the registry to get this. And you may have to write a custom function that can pull installed app id's from Steam and pull details from an online API that tells you what game title is what app id.
Or use an already in existent service such as https://steamdb.info
|