WMI访问拒绝excptn
问题描述:
string s = Form1.ipadd;
string devic;
devic = comboBox1.Text;
groupBox2.Text = devic + " Information";
ConnectionOptions _Options = new ConnectionOptions();
_Options.Username = "Babar";
_Options.Password = "";
ManagementPath _Path = new ManagementPath(s);
ManagementScope _Scope = new ManagementScope(_Path, _Options);
_Scope.Connect();
ManagementObjectSearcher srcd = new ManagementObjectSearcher("select * from "+devic);
tsprogress.Value = 0;
Allplabel.Text = " : 0%";
foreach (ManagementObject obj in srcd.Get())
{
//listBox5.Items.Add(obj.Properties.ToString());
foreach (PropertyData aProperty in obj.Properties)
{
i++;
tsprogress.Value = (i/cont) * 100;
Allplabel.Text = tsprogress.Value.ToString() + "%";
richTextBox1.AppendText(aProperty.Name.ToString() + " : " + aProperty.Value+"\n");
}
}
///////////////////////// 上述代码在本地主机上正常工作,但在访问时不起作用远程系统......访问被拒绝exculat ...我将非常感激2你的帮助。WMI访问拒绝excptn
错误消息非常特殊:您正在运行该代码的凭据无权访问远程计算机。 – 2009-12-22 15:36:08