public static string GetFirewall() { try { string firewallName = string.Empty; // starting with Windows Vista we must use the root\SecurityCenter2 namespace string scope = (PlatformYardımcısı.VistaYadaÜstü) ? "root\\SecurityCenter2" : "root\\SecurityCenter"; string query = "SELECT * FROM FirewallProduct"; using (ManagementObjectSearcher searcher = new ManagementObjectSearcher(scope, query)) { foreach (ManagementObject mObject in searcher.Get()) { firewallName += mObject["displayName"].ToString() + "; "; } } firewallName = FormatYardımcısı.RemoveEnd(firewallName); return((!string.IsNullOrEmpty(firewallName)) ? firewallName : "N/A"); } catch { return("Unknown"); } }
public static string GetGpuName() { try { string gpuName = string.Empty; string query = "SELECT * FROM Win32_DisplayConfiguration"; using (ManagementObjectSearcher searcher = new ManagementObjectSearcher(query)) { foreach (ManagementObject mObject in searcher.Get()) { gpuName += mObject["Description"].ToString() + "; "; } } gpuName = FormatYardımcısı.RemoveEnd(gpuName); return((!string.IsNullOrEmpty(gpuName)) ? gpuName : "N/A"); } catch { return("Unknown"); } }
public static string GetCpuName() { try { string cpuName = string.Empty; string query = "SELECT * FROM Win32_Processor"; using (ManagementObjectSearcher searcher = new ManagementObjectSearcher(query)) { foreach (ManagementObject mObject in searcher.Get()) { cpuName += mObject["Name"].ToString() + "; "; } } cpuName = FormatYardımcısı.RemoveEnd(cpuName); return((!string.IsNullOrEmpty(cpuName)) ? cpuName : "N/A"); } catch { } return("Unknown"); }