我试图从连接在局域网中的远程机器获取操作系统系统..我使用以下代码..我收到错误“访问被拒绝”任何人都可以帮助我..提前谢谢
ManagementScope scope = new ManagementScope(@"\\"+ ip +"\\root\\cimv2");
SelectQuery query = new SelectQuery();
query.QueryString = "select * from Win32_OperatingSystem";
ManagementObjectSearcher searcher = new ManagementObjectSearcher(scope, query);
ManagementObjectCollection queryCollection = searcher.Get();