Support detection of multiple AVs, Firewalls, GPUs, CPUs

This commit is contained in:
MaxXor 2015-08-23 22:15:19 +02:00
parent d6bdeaea12
commit f8c72b7c0a
2 changed files with 15 additions and 4 deletions

View File

@ -32,5 +32,12 @@ namespace xClient.Core.Helper
{
return string.Format("{0}x{1}", resolution.Width, resolution.Height);
}
public static string RemoveEnd(string input)
{
if (input.Length > 2)
input = input.Remove(input.Length - 2);
return input;
}
}
}

View File

@ -85,9 +85,10 @@ namespace xClient.Core
{
foreach (ManagementObject mObject in searcher.Get())
{
cpuName = mObject["Name"].ToString();
cpuName = mObject["Name"].ToString() + "; ";
}
}
cpuName = FormatHelper.RemoveEnd(cpuName);
return (!string.IsNullOrEmpty(cpuName)) ? cpuName : "N/A";
}
@ -133,9 +134,10 @@ namespace xClient.Core
{
foreach (ManagementObject mObject in searcher.Get())
{
gpuName = mObject["Description"].ToString();
gpuName = mObject["Description"].ToString() + "; ";
}
}
gpuName = FormatHelper.RemoveEnd(gpuName);
return (!string.IsNullOrEmpty(gpuName)) ? gpuName : "N/A";
}
@ -158,9 +160,10 @@ namespace xClient.Core
{
foreach (ManagementObject mObject in searcher.Get())
{
antivirusName = mObject["displayName"].ToString();
antivirusName = mObject["displayName"].ToString() + "; ";
}
}
antivirusName = FormatHelper.RemoveEnd(antivirusName);
return (!string.IsNullOrEmpty(antivirusName)) ? antivirusName : "N/A";
}
@ -183,9 +186,10 @@ namespace xClient.Core
{
foreach (ManagementObject mObject in searcher.Get())
{
firewallName = mObject["displayName"].ToString();
firewallName = mObject["displayName"].ToString() + "; ";
}
}
firewallName = FormatHelper.RemoveEnd(firewallName);
return (!string.IsNullOrEmpty(firewallName)) ? firewallName : "N/A";
}