I need to read a website\'s folders using WMI and C# in IIS 6.0. I am able to read the Virtual directories and applications using the \"IISWebVirtualDirSetting\
Never mind. i got it myself. If the directory structure is on local system the System.IO.DirectoryInfo is what is needed. Using remoting the same can be used for remote server as well.
Reference: http://msdn.microsoft.com/en-us/library/system.io.directoryinfo.aspx
If WMi has to be there then Win32_Directory is the class which should used in query:
"Select * from Win32_directory where drive ='"+ DriveLetter +":' and Path ='%" + MyPath + "%'";
Reference: http://msdn.microsoft.com/en-us/library/aa394130(VS.85).aspx