日期:2014-05-18  浏览次数:20928 次

ManagementException : Invalid parameter异常如何解决?
ManagementScope Conn = new ManagementScope("\\\\" + txtWmiIpOrAddress.Text + "\\root\\cimv2", options); 处报错:ManagementException : Invalid parameter

------解决方案--------------------
貌似是你斜线是半角的吧???
ManagementScope Conn = new ManagementScope("\\\\" + txtWmiIpOrAddress.Text + "\\root\\cimv2", options);

ManagementScope 类
===================》

 ManagementScope Conn = new ManagementScope("\\\\FullComputerName\\root\\cimv2");
 scope.Connect();

详细参考:MSDN
http://msdn.microsoft.com/zh-cn/library/system.management.managementscope%28VS.80%29.aspx

------解决方案--------------------
目测反斜杠是全角的,全角字符不是合法的路径字符,