Step 1
First create a blank Windows Project. Name it ‘UniqueHardwareId’.
Step 2
In MainPage.xaml add a button with click event and a textbox to display the hardware id:
Complete XAML code
- <Page
- x:Class="UniqueHardwareId.MainPage"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:local="using:UniqueHardwareId"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- mc:Ignorable="d">
- <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
- <Button x:Name="btnGetHwId" Content="Get Hardware ID" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="353,250,0,0" Height="99" FontSize="35" Width="743" Click="btnGetHwId_Click"/>
- <TextBox x:Name="txtId" HorizontalAlignment="Left" FontSize="30" TextWrapping="Wrap" VerticalAlignment="Top" Margin="356,409,0,0" Height="87" Width="737"/>
- </Grid>
- </Page>


Join the conversation! Your thoughts help the community grow.