ManagementUnit.ConfigurationPath 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取当前管理单元的配置路径信息。
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 + "\"");
}
适用于
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈