ConfigurationUserLevel 列挙体
アセンブリ: System.Configuration (system.configuration.dll 内)

Public Enumeration ConfigurationUserLevel

メンバ名 | 説明 | |
---|---|---|
None | すべてのユーザーに適用する Configuration を取得します。 | |
PerUserRoaming | 現在のユーザーに適用するローミング Configuration を取得します。 | |
PerUserRoamingAndLocal | 現在のユーザーに適用するローカル Configuration を取得します。 |

ConfigurationUserLevel を使用して、ConfigurationManager.OpenExeConfiguration および System.Configuration.ConfigurationManager.OpenExeConfiguration によって返された構成オブジェクトで表される構成ファイルを指定します。
アプリケーション構成ファイルは、アプリケーションと同じディレクトリ内にあり、同じ名前が付けられていますが、拡張子は .config です。たとえば、C:\System\Public.exe の構成ファイルは C:\System\Public.exe.config です。
アプリケーションでは、すべてのユーザーに適用するグローバル構成、個々のユーザーに適用する個別構成、およびローミング ユーザーに適用する構成を使用します。

ConfigurationUserLevel 列挙体を使用する方法の例を次に示します。この例は、ConfigurationManager のトピックで取り上げている例の一部分です。
' Modify a custom section. Show how to use the ' OpenExeConfiguration(ConfigurationUserLevel) method. Shared Sub ModifyCustomSection() ' Get the application configuration file. Dim config As System.Configuration.Configuration = _ ConfigurationManager.OpenExeConfiguration( _ ConfigurationUserLevel.None) Console.WriteLine(config.FilePath) Dim custSection As CustomSection = _ config.Sections(customSectionName) custSection.FileName = "newName.txt" custSection.MaxIdleTime = New TimeSpan(0, 15, 0) custSection.MaxUsers = custSection.MaxUsers + 10 If Not custSection.ElementInformation.IsLocked Then config.Save() Else Console.WriteLine("Section was locked, could not update.") End If End Sub 'ModifyCustomSection
// Modify a custom section. Show how to use the // OpenExeConfiguration(ConfigurationUserLevel) method. static void ModifyCustomSection() { // Get the application configuration file. System.Configuration.Configuration config = ConfigurationManager.OpenExeConfiguration( ConfigurationUserLevel.None); Console.WriteLine(config.FilePath); CustomSection custSection = config.Sections[customSectionName] as CustomSection; custSection.FileName = "newName.txt"; custSection.MaxIdleTime = new TimeSpan(0, 15, 0); custSection.MaxUsers = custSection.MaxUsers + 10; if (!custSection.ElementInformation.IsLocked) config.Save(); else Console.WriteLine("Section was locked, could not update."); }

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からConfigurationUserLevel 列挙体を検索する場合は、下記のリンクをクリックしてください。

- ConfigurationUserLevel 列挙体のページへのリンク