首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

ManagementException : Invalid parameter错误怎么解决

2012-05-04 
ManagementException : Invalid parameter异常如何解决?ManagementScope Conn new ManagementScope(\\\

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

[解决办法]
目测反斜杠是全角的,全角字符不是合法的路径字符,

热点排行