ConnectionOptions objConnection = new ConnectionOptions(); string strMachineName = System.Environment.MachineName; ManagementScope objScope = new ManagementScope(@"\\" + strMachineName + @"\root\cimv2");//, objConnection); objScope.Connect(); (Getting a generic failure error at this line) SelectQuery selectQuery = new SelectQuery(); selectQuery.QueryString = "Select * from win32_Printer"; ManagementObjectSearcher MOS = new ManagementObjectSearcher(objScope, selectQuery); ManagementObjectCollection MOC = MOS.Get();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)