How to read an IIS 6 Website's Directory Structure using WMI?

前端 未结 2 427
梦毁少年i
梦毁少年i 2021-02-10 09:38

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\

相关标签:
2条回答
  • 2021-02-10 10:02

    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

    0 讨论(0)
  • 2021-02-10 10:18

    Have you looked at the Web Deployment Tool?

    http://www.iis.net/expand/WebDeploy

    Ability to package ACLs, COM, GAC and registry settings.

    0 讨论(0)
提交回复
热议问题