KeyPerFileConfigurationBuilderExtensions.AddKeyPerFile 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
AddKeyPerFile(IConfigurationBuilder, Action<KeyPerFileConfigurationSource>) |
使用目录中的文件添加配置。 文件名用作键,文件内容用作值。 |
AddKeyPerFile(IConfigurationBuilder, String) |
使用目录中的文件添加配置。 文件名用作键,文件内容用作值。 |
AddKeyPerFile(IConfigurationBuilder, String, Boolean) |
使用目录中的文件添加配置。 文件名用作键,文件内容用作值。 |
AddKeyPerFile(IConfigurationBuilder, String, Boolean, Boolean) |
使用目录中的文件添加配置。 文件名用作键,文件内容用作值。 |
AddKeyPerFile(IConfigurationBuilder, Action<KeyPerFileConfigurationSource>)
使用目录中的文件添加配置。 文件名用作键,文件内容用作值。
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::Extensions::Configuration::IConfigurationBuilder ^ AddKeyPerFile(Microsoft::Extensions::Configuration::IConfigurationBuilder ^ builder, Action<Microsoft::Extensions::Configuration::KeyPerFile::KeyPerFileConfigurationSource ^> ^ configureSource);
public static Microsoft.Extensions.Configuration.IConfigurationBuilder AddKeyPerFile (this Microsoft.Extensions.Configuration.IConfigurationBuilder builder, Action<Microsoft.Extensions.Configuration.KeyPerFile.KeyPerFileConfigurationSource> configureSource);
static member AddKeyPerFile : Microsoft.Extensions.Configuration.IConfigurationBuilder * Action<Microsoft.Extensions.Configuration.KeyPerFile.KeyPerFileConfigurationSource> -> Microsoft.Extensions.Configuration.IConfigurationBuilder
<Extension()>
Public Function AddKeyPerFile (builder As IConfigurationBuilder, configureSource As Action(Of KeyPerFileConfigurationSource)) As IConfigurationBuilder
参数
- builder
- IConfigurationBuilder
要添加到的 IConfigurationBuilder。
- configureSource
- Action<KeyPerFileConfigurationSource>
配置源。
返回
适用于
AddKeyPerFile(IConfigurationBuilder, String)
使用目录中的文件添加配置。 文件名用作键,文件内容用作值。
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::Extensions::Configuration::IConfigurationBuilder ^ AddKeyPerFile(Microsoft::Extensions::Configuration::IConfigurationBuilder ^ builder, System::String ^ directoryPath);
public static Microsoft.Extensions.Configuration.IConfigurationBuilder AddKeyPerFile (this Microsoft.Extensions.Configuration.IConfigurationBuilder builder, string directoryPath);
static member AddKeyPerFile : Microsoft.Extensions.Configuration.IConfigurationBuilder * string -> Microsoft.Extensions.Configuration.IConfigurationBuilder
<Extension()>
Public Function AddKeyPerFile (builder As IConfigurationBuilder, directoryPath As String) As IConfigurationBuilder
参数
- builder
- IConfigurationBuilder
要添加到的 IConfigurationBuilder。
- directoryPath
- String
目录的路径。
返回
适用于
AddKeyPerFile(IConfigurationBuilder, String, Boolean)
使用目录中的文件添加配置。 文件名用作键,文件内容用作值。
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::Extensions::Configuration::IConfigurationBuilder ^ AddKeyPerFile(Microsoft::Extensions::Configuration::IConfigurationBuilder ^ builder, System::String ^ directoryPath, bool optional);
public static Microsoft.Extensions.Configuration.IConfigurationBuilder AddKeyPerFile (this Microsoft.Extensions.Configuration.IConfigurationBuilder builder, string directoryPath, bool optional);
static member AddKeyPerFile : Microsoft.Extensions.Configuration.IConfigurationBuilder * string * bool -> Microsoft.Extensions.Configuration.IConfigurationBuilder
<Extension()>
Public Function AddKeyPerFile (builder As IConfigurationBuilder, directoryPath As String, optional As Boolean) As IConfigurationBuilder
参数
- builder
- IConfigurationBuilder
要添加到的 IConfigurationBuilder。
- directoryPath
- String
目录的路径。
- optional
- Boolean
该目录是否为选填。
返回
适用于
AddKeyPerFile(IConfigurationBuilder, String, Boolean, Boolean)
使用目录中的文件添加配置。 文件名用作键,文件内容用作值。
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::Extensions::Configuration::IConfigurationBuilder ^ AddKeyPerFile(Microsoft::Extensions::Configuration::IConfigurationBuilder ^ builder, System::String ^ directoryPath, bool optional, bool reloadOnChange);
public static Microsoft.Extensions.Configuration.IConfigurationBuilder AddKeyPerFile (this Microsoft.Extensions.Configuration.IConfigurationBuilder builder, string directoryPath, bool optional, bool reloadOnChange);
static member AddKeyPerFile : Microsoft.Extensions.Configuration.IConfigurationBuilder * string * bool * bool -> Microsoft.Extensions.Configuration.IConfigurationBuilder
<Extension()>
Public Function AddKeyPerFile (builder As IConfigurationBuilder, directoryPath As String, optional As Boolean, reloadOnChange As Boolean) As IConfigurationBuilder
参数
- builder
- IConfigurationBuilder
要添加到的 IConfigurationBuilder。
- directoryPath
- String
目录的路径。
- optional
- Boolean
该目录是否为选填。
- reloadOnChange
- Boolean
更改、添加或删除文件时是否应重新加载配置。