这是一个与远程主机的WMI连接的简单示例:
string FullComputerPathName=@"\\mycomputer\root\cimv2";
ConnectionOptions options = new ConnectionOptions();
options.Password = "some_password";
options.Username = "some_user";
ManagementScope scope = new ManagementScope(FullComputerPathName,options);
scope.Connect();
是否有机会选择其中一种选择:
1) 使用IP代理到达远程主机。 示例(类似这样):
ManagementScope scope = new ManagementScope(FullComputerPathName,options);
**scope.ProxyIP = myIPaddress**
scope.Connect();
2) 在WMI连接上指定源ip。 示例(类似这样):
ManagementScope scope = new ManagementScope(FullComputerPathName,options);
**scope.Connection.SourceIP = myIPaddress**
scope.Connect();
提前感谢任何提示!