2012-01-03 33 views
0

我需要创建远程文件系统的树视图。要做到这一点,我正在使用WMI和mgmtclassgen.exe强类型wmi获取子文件夹

使用Win32_LogicalDisk我得到我的驱动器号。

现在,当用户想要浏览其子文件夹我想要得到的子文件夹,我能够获得,使用

ManagementObjectSearcher(@"root\CIMV2", @"Associators of {Win32_Directory.Name='e:\'} Where AssocClass =Win32_Subdirectory ResultRole = PartComponent") 

但这不是强类型。我如何使用强类型的Win32_Directory和Win32_Subdirectory来获取子文件夹?

+1

为什么你需要强类型? – RRUZ 2012-01-03 15:48:57

+0

因为它更清洁,加上intellisense会让我知道所有可用的属性 – 2012-01-04 04:17:47

回答

0

目前没有任何.NET实现wmi,所以没有强烈的打字。

(我目前正在研究.net的实现)。