本文介绍了C#中的WmiClass - 未知参考详细信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 限时删除!! 你好 这是我的代码。 String dnsServerName = localhost; ManagementScope范围= 新 ManagementScope( @ \\ + dnsServerName + \\root \\ MicrosoftDNS); scope.Connect(); ManagementClass cmiClass = new ManagementClass(范围, new ManagementPath( MicrosoftDNS_AType), 空); ManagementBaseObject inParams = wmiClass.GetMethodParameters( CreateInstanceFromPropertyData ); inParams [ DnsServerName] = 此 .ServerName; inParams [ ContainerName] = zone; inParams [ OwnerName] = hostName + 。 + zone; inParams [ IPAddress] = iPAddress; cmiClass.InvokeMethod( CreateInstanceFromPropertyData,inParams, null ); 我能够成功引用''ManagementClass'。 但是我用google搜索并用谷歌搜索但我不明白如何正确引用wmiClass。 请可以有人帮助我。 谢谢解决方案 wmiClass改为cmiClass 谢谢Sergey和Ganesh !! :) HelloHere is my code.String dnsServerName = "localhost"; ManagementScope scope = new ManagementScope(@"\\" + dnsServerName + "\\root\\MicrosoftDNS"); scope.Connect(); ManagementClass cmiClass = new ManagementClass(scope, new ManagementPath("MicrosoftDNS_AType"), null); ManagementBaseObject inParams = wmiClass.GetMethodParameters("CreateInstanceFromPropertyData"); inParams["DnsServerName"] = this.ServerName; inParams["ContainerName"] = zone; inParams["OwnerName"] = hostName + "." + zone; inParams["IPAddress"] = iPAddress; cmiClass.InvokeMethod("CreateInstanceFromPropertyData", inParams, null);I was able to reference ''ManagementClass'' successfully.But I have googled and googled but I don''t understand how to reference wmiClass correctly.Please can some one help me.Thanks 解决方案 wmiClass changed to cmiClassThank you Sergey and Ganesh!! :) 这篇关于C#中的WmiClass - 未知参考详细信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 1403页,肝出来的.. 09-08 00:27