Hey folks, I just recently got into C# and want to create a Desktop app to get comfortable with it. I created a WPF Project with .NET 8.0 as the Target Framework and wanted to get the name of the user's mainboard.
I used this piece of logic, which requires the ManagementObject, which requires me to use the System.Management namespace
public static String getMotherboardName(){ var searcher = new ManagementObjectSearcher("SELECT * FROM Win32_BaseBoard"); foreach (var item in searcher.Get()) { return item["Product"].ToString(); } return "Unknown Motherboard";}
public static String getMotherboardName(){ var searcher = new ManagementObjectSearcher("SELECT * FROM Win32_BaseBoard"); foreach (var item in searcher.Get()) { return item["Product"].ToString(); } return "Unknown Motherboard";}
I tried to add said reference but I cant find it in the Reference Manager.