主题:WMI问题请教
private void button1_Click(object sender, System.EventArgs e)
{
ConnectionOptions oConn = new ConnectionOptions();
oConn.Username = "administrator";
oConn.Password = "123";
ManagementPath p = new ManagementPath("\\\\192.192.192.192\\root\\cimv2"); //localhost
ManagementScope ms = new ManagementScope(p,oConn);
ObjectQuery oq = new ObjectQuery("SELECT * FROM Win32_Service");
ManagementObjectSearcher query1 = new ManagementObjectSearcher(ms,oq);
ManagementObjectCollection queryCollection1 = query1.Get();
}
请教各位:为什么连接本地的时候没有问题,但一连接远程的时候就会在最后一句报“拒绝访问”的错误(网络通畅,用户名密码正确,远程 Window Management Instrumentation 服务开启),请问还要怎么做才能能使远程连接正常。
{
ConnectionOptions oConn = new ConnectionOptions();
oConn.Username = "administrator";
oConn.Password = "123";
ManagementPath p = new ManagementPath("\\\\192.192.192.192\\root\\cimv2"); //localhost
ManagementScope ms = new ManagementScope(p,oConn);
ObjectQuery oq = new ObjectQuery("SELECT * FROM Win32_Service");
ManagementObjectSearcher query1 = new ManagementObjectSearcher(ms,oq);
ManagementObjectCollection queryCollection1 = query1.Get();
}
请教各位:为什么连接本地的时候没有问题,但一连接远程的时候就会在最后一句报“拒绝访问”的错误(网络通畅,用户名密码正确,远程 Window Management Instrumentation 服务开启),请问还要怎么做才能能使远程连接正常。