Прочитайте реестр с помощью WMI и используйте microsoft.management.infrastructure с помощью cimsession.
I have the following code:
ManagementClass ObjManagementClassRegistry = new ManagementClass(_objPublicManagementScope, new ManagementPath("StdRegProv"), null); ManagementBaseObject inParams = ObjManagementClassRegistry.GetMethodParameters("GetStringValue"); inParams["hDefKey"] = 0x80000002;// HKEY_LOCAL_MACHINE; inParams["sSubKeyName"] = @"SOFTWARE\Microsoft\Windows NT\CurrentVersion"; inParams["sValueName"] = "UBR"; ManagementBaseObject ObjOutParams = ObjManagementClassRegistry.InvokeMethod("GetDWORDValue", inParams, null); if (Convert.ToUInt32(ObjOutParams["ReturnValue"]) == 0) { var ddd = ObjOutParams["uValue"]; }
Что я уже пробовал:
The problem I need to do is in the Microsoft.Management.Infrastructure assembly. I want to read the Subversion remotely from the operating system. Remote Registry and Remote PowerShell are not allowed :-(
I want to thank you in advance for your help
Greetings Brauschi
Dave Kreskowiak
Вы говорите об этом -> GitHub - PowerShell/MMI[^] (Microsoft.Management.Инфраструктура)?
Brauschi
Нет, речь идет о сборке преемника для управления системой.
Видишь ли https://docs.microsoft.com/de-de/windows/win32/wmisdk/connecting-to-wmi-remotely-with-c-?redirectedfrom=MSDN