ManagementUnit.ConfigurationPath 属性

定义

获取当前管理单元的配置路径信息。

public:
 property Microsoft::Web::Management::Server::ManagementConfigurationPath ^ ConfigurationPath { Microsoft::Web::Management::Server::ManagementConfigurationPath ^ get(); };
public Microsoft.Web.Management.Server.ManagementConfigurationPath ConfigurationPath { get; }
member this.ConfigurationPath : Microsoft.Web.Management.Server.ManagementConfigurationPath
Public ReadOnly Property ConfigurationPath As ManagementConfigurationPath

属性值

一个 ManagementConfigurationPath ,它包含当前管理单元的配置路径信息。

示例

以下示例演示如何使用 ConfigurationPath 属性。 TraceCnfPath当 IIS 管理器在默认网站下有 App_Data 文件夹或ra应用程序时调用 方法时,将显示以下跟踪输出。

ConfigurationPath.ApplicationPath "/ra"

FolderPath "App_Data"

PathType "Folder"

SiteName "Default Web Site"

public class DemoModuleService : ModuleService {

    [ModuleServiceMethod]
    public ArrayList GetSettings() {
        ManagementConfiguration manConfig = this.ManagementUnit.Configuration;
        ConfigurationSection appSetSect = manConfig.GetSection("appSettings");
        ConfigurationElementCollection settings = appSetSect.GetCollection();

}
}
public void TraceCnfPath() {

    ManagementUnit mu = this.ManagementUnit;

    Trace.WriteLine("ConfigurationPath.ApplicationPath \"" +
        mu.ConfigurationPath.ApplicationPath + "\"");
    Trace.WriteLine("FolderPath \"" +
        mu.ConfigurationPath.FolderPath + "\"");
    Trace.WriteLine("PathType \"" +
        mu.ConfigurationPath.PathType + "\"");
    Trace.WriteLine("SiteName \"" +
        mu.ConfigurationPath.SiteName + "\"");
} 

适用于