[問題] 一個 WMI 的問題
我在網路上看到一個範例
它是用 WMI 來取得電腦的一些資訊 :比如硬碟 size 等等
我的的問題是 它只能抓到自己 localhost 端的資料
請問如果要自己指定 抓某台 IP 的資訊 該怎麼做呢
謝謝
網路範例如下
//Connection credentials to the remote computer -
//not needed if the logged in account has access
ConnectionOptions oConn = new ConnectionOptions();
//oConn.Username = "usename";
//oConn.Password = "password";
System.Management.ManagementScope oMs =
new System.Management.ManagementScope("\\\\localhost", oConn);
//get Fixed disk stats
System.Management.ObjectQuery oQuery =
new System.Management.ObjectQuery("select FreeSpace,Size,Name from Win32_LogicalDisk where DriveType=3");
ManagementObjectSearcher oSearcher = new ManagementObjectSearcher(oMs,oQuery);
ManagementObjectCollection oReturnCollection = oSearcher.Get();
-----------------------------------------------------------------------
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.118.155.66
推
140.113.91.10 08/04, , 1F
140.113.91.10 08/04, 1F
C_Sharp 近期熱門文章
PTT數位生活區 即時熱門文章
14
23