Я пытаюсь использовать "GetEncryptionMethod" который принимает два параметра out, но я не уверен, как передать это в моем коде С#. Вот код:
ManagementScope scope = new ManagementScope("\\\\.\\ROOT\\CIMV2\\Security\\MicrosoftVolumeEncryption");
CallMethod(scope);
public static void CallMethod(ManagementScope scope)
{
try
{
ManagementClass cls = new ManagementClass(scope.Path.Path, "Win32_EncryptableVolume", null);
foreach (var t in cls.Methods)
{
Console.WriteLine(t.Name); //this prints all method including GetEncryptionMethod
}
ManagementBaseObject inParams = cls.GetMethodParameters("GetEncryptionMethod"); //this returns null
//How do we pass out parameter here?
//inParams["EncryptionMethod"] = 1;
//inParams["SelfEncryptionDriveEncryptionMethod"] = null;
ManagementBaseObject outSiteParams = cls.InvokeMethod("GetEncryptionMethod", null, null);
}
catch (ManagementException e)
{
throw new Exception("Failed to execute method", e);
}
}
out
. См. модификатор параметра out (справочник по C#). )а> - person Rita Han   schedule 30.05.2019