【发布时间】:2015-05-14 10:51:36
【问题描述】:
Msvm_ReplicationService::GetReplicationStatisticsEx方法需要两个参数:
[in] CIM_ComputerSystem ComputerSystem,
[in] string ReplicationRelationship,
ReplicationRelationship 是一个对象,所以我不知道它为什么需要它作为字符串。 文档说:
“ReplicationRelationship [in] Msvm_ReplicationRelationship 类的嵌入式实例的字符串表示形式,它定义了要为其检索复制统计信息的复制关系。”不知道这意味着什么!
当我传入以下内容时,我收到“无效参数”错误:
rel.ToString()
和
rel["InstanceID"].ToString()
有人知道如何调用这个方法吗?
这是 rel 的来源:
ManagementObjectSearcher searcher = new ManagementObjectSearcher("root\\virtualization\\v2", "SELECT * FROM Msvm_ReplicationRelationship");
foreach (ManagementObject rel in searcher.Get()) {
//string representation of rel required here
//At the moment, just looping through all relationships for simplicity
}
【问题讨论】: