Skip to content
This repository was archived by the owner on Apr 1, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.22")]
[assembly: AssemblyFileVersion("1.0.0.22")]
[assembly: AssemblyVersion("1.0.0.23")]
[assembly: AssemblyFileVersion("1.0.0.23")]
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
using Microsoft.Win32;
using System;
using System;
using System.Linq;
using System.Management;
using System.Threading.Tasks;
using System.Windows.Input;
using Microsoft.Win32;

namespace GoogleAnalyticsClientDotNet.Utility
{
Expand Down Expand Up @@ -31,7 +32,7 @@ public bool IsTouchEnabled
public string ModelName
{
get; private set;
}
} = string.Empty;

public string Name
{
Expand All @@ -56,7 +57,7 @@ public string SystemArchitecture
public string SystemManufacturer
{
get; private set;
}
} = string.Empty;

private static string uniqueId;
public string UniqueId
Expand Down Expand Up @@ -137,13 +138,23 @@ public DeviceInformationService()
//initialize the searcher with the query it is supposed to execute
using (ManagementObjectSearcher searcher = new ManagementObjectSearcher(query))
{
//execute the query
foreach (System.Management.ManagementObject process in searcher.Get())
try
{
//print system info
process.Get();
SystemManufacturer = $"{process["Manufacturer"]}";
ModelName = $"{process["Model"]}";
Task.Run(() =>
{
foreach (ManagementObject process in searcher.Get())
{
//print system info
process.Get();
SystemManufacturer = $"{process["Manufacturer"]}";
ModelName = $"{process["Model"]}";
}
}
);
}
catch (Exception)
{

}
}
}
Expand Down