Interaction.GetAllSettings メソッド
アセンブリ: Microsoft.VisualBasic (microsoft.visualbasic.dll 内)

Dim AppName As String Dim Section As String Dim returnValue As String( ,) returnValue = Interaction.GetAllSettings(AppName, Section)
- Section
必須。キー設定が必要となるセクションの名前を含む String 式です。GetAllSettings は、文字列の 2 次元配列を含むオブジェクトを返します。文字列には、指定されたセクションにあるすべてのキー設定に加え、その設定に対応する値も含まれます。
Windows レジストリのアプリケーションのエントリから、キー設定のリストと各キー設定の値 (以前に SaveSetting を使用して作成されたもの) を返します。 My 機能を使用すると、GetAllSettings を使用した場合より生産性とパフォーマンスが向上します。詳細については、「My.Computer.Registry オブジェクト」を参照してください。

詳細については、Visual Basic のトピック「GetAllSettings 関数」を参照してください。
AppName と Section のどちらも存在しない場合、GetAllSettings は初期化されていない Object を返します。
この機能の動作に使用される HKEY_LOCAL_USER レジストリ キーは、ユーザーが対話形式でログオンするまでアクティブにならないため、GetAllSettings を使用するにはユーザーがログオンしている必要があります。
対話形式でないプロセス (Mtx.exe など) からアクセスされるレジストリ設定は、HKEY_LOCAL_MACHINE\Software\ レジストリ キーまたは HKEY_USER\DEFAULT\Software レジストリ キーの下に保存する必要があります。

この例では、まず SaveSetting 関数を使用して、Windows レジストリに AppName で指定されたアプリケーションのエントリを作成した後、GetAllSettings 関数を使用してその設定を表示します。アプリケーション名と Section 名は、GetAllSettings では取得できないので注意してください。最後に、DeleteSetting 関数を使用してアプリケーションのエントリを削除します。
' Object to hold 2-dimensional array returned by GetAllSettings. ' Integer to hold counter. Dim MySettings(,) As String Dim intSettings As Integer ' Place some settings in the registry. SaveSetting("MyApp", "Startup", "Top", "75") SaveSetting("MyApp", "Startup", "Left", "50") ' Retrieve the settings. MySettings = GetAllSettings("MyApp", "Startup") For intSettings = LBound(MySettings, 1) To UBound(MySettings, 1) WriteLine(1, MySettings(intSettings, 0)) WriteLine(1, MySettings(intSettings, 1)) Next intSettings DeleteSetting("MyApp")

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


- Interaction.GetAllSettings メソッドのページへのリンク