Registry.DynData フィールド
アセンブリ: mscorlib (mscorlib.dll 内)


例外の種類 | 条件 |
---|---|
ObjectDisposedException | オペレーティング システムが、Windows 98、Windows 98 Second Edition、Windows Millennium Edition のいずれでもありません。 |

Windows 98 や Windows Me のレジストリでは、静的データ (ディスク上のレジストリに格納されているデータ) と動的データ (パフォーマンス統計など、頻繁に変更されるデータ) の両方がサポートされています。動的データ領域とは、リモート コンピュータとローカル コンピュータの両方で稼動する Win 32 アプリケーションに対し、仮想デバイス ドライバ (VxDs) がリアルタイムでデータを提供するための機構です。この機構により、システム モニタはリモート コンピュータの Windows 98 システムや Windows Me システムのパフォーマンス統計を用意できます。
VxDs では、パフォーマンス データ以外のデータも取り扱われます。VxDs は、CPU を占有せずに、効率的にリング 0 からリング 3 に渡すデータを用意できます。レジストリでは、1 つ以上の値を返す関数を指すポインタを格納し、動的データを使用できるようにします。レジストリが動的キーに関連付けられているキューを呼び出すと、その関数が呼び出され、必要な値を返します。
![]() |
---|
動的キーは、動的レジストリ データを処理するために Microsoft Windows 95 で導入されました。動的キーは Windows 98 と Windows Me だけでサポートされています。 |

このキーのサブキーを取得し、これらのサブキーの名前を画面に出力する方法の例を次に示します。必要な特定のサブキーのインスタンスを作成するには、OpenSubKey メソッドを使用します。次に、RegistryKey で別の演算を使用して、そのキーを操作します。この例では、使用できる動的データがない場合や Windows 98/ME が実行されていない場合に、結果が返されないことがあります。このキーを Windows 98/ME 以外のシステムで使用すると、エラーが発生する場合があります。
Imports System Imports Microsoft.Win32 Class Reg Public Shared Sub Main() ' Create a RegistryKey, which will access the HKEY_DYN_DATA ' key in the registry of this machine. Dim rk As RegistryKey = Registry.DynData ' Print out the keys. PrintKeys(rk) End Sub Shared Sub PrintKeys(rkey As RegistryKey) ' Retrieve all the subkeys for the specified key. Dim names As String() Try names = rkey.GetSubKeyNames() Catch ex As System.IO.IOException Console.WriteLine("HKEY_DYN_DATA is not available on this machine.") Exit Sub End Try Dim icount As Integer = 0 Console.WriteLine("Subkeys of " & rkey.Name) Console.WriteLine("-----------------------------------------------") ' Print the contents of the array to the console. Dim s As String For Each s In names Console.WriteLine(s) ' The following code puts a limit on the number ' of keys displayed. Comment it out to print the ' complete list. icount += 1 If icount >= 10 Then Exit For End If Next s End Sub End Class
using System; using Microsoft.Win32; class Reg { public static void Main() { // Create a RegistryKey, which will access the HKEY_DYN_DATA // key in the registry of this machine. RegistryKey rk = Registry.DynData; // Print out the keys. PrintKeys(rk); } static void PrintKeys(RegistryKey rkey) { // Retrieve all the subkeys for the specified key. String [] names; try { names = rkey.GetSubKeyNames(); } catch (System.IO.IOException e) { Console.WriteLine("HKEY_DYN_DATA is not available on this machine."); return; } int icount = 0; Console.WriteLine("Subkeys of " + rkey.Name); Console.WriteLine("-----------------------------------------------"); // Print the contents of the array to the console. foreach (String s in names) { Console.WriteLine(s); // The following code puts a limit on the number // of keys displayed. Comment it out to print the // complete list. icount++; if (icount >= 10) break; } } }
using namespace System; using namespace Microsoft::Win32; void PrintKeys( RegistryKey ^ rkey ) { // Retrieve all the subkeys for the specified key. array<String^>^names; try { names = rkey->GetSubKeyNames(); } catch ( System::IO::IOException^ ) { Console::WriteLine( "HKEY_DYN_DATA is not available on this machine." ); return; } int icount = 0; Console::WriteLine( "Subkeys of {0}", rkey->Name ); Console::WriteLine( "-----------------------------------------------" ); // Print the contents of the array to the console. System::Collections::IEnumerator^ enum0 = names->GetEnumerator(); while ( enum0->MoveNext() ) { String^ s = safe_cast<String^>(enum0->Current); Console::WriteLine( s ); // The following code puts a limit on the number // of keys displayed. Comment it out to print the // complete list. icount++; if ( icount >= 10 ) break; } } int main() { // Create a RegistryKey, which will access the HKEY_DYN_DATA // key in the registry of this machine. RegistryKey ^ rk = Registry::DynData; // Print out the keys. PrintKeys( rk ); }
import System.*; import Microsoft.Win32.*; class Reg { public static void main(String[] args) { // Create a RegistryKey, which will access the HKEY_DYN_DATA // key in the registry of this machine. RegistryKey rk = Registry.DynData; // Print out the keys. PrintKeys(rk); } //main static void PrintKeys(RegistryKey rKey) { // Retrieve all the subkeys for the specified key. String names[]; try { names = rKey.GetSubKeyNames(); } catch (System.IO.IOException e) { Console.WriteLine("HKEY_DYN_DATA is not available on this machine."); return; } int iCount = 0; Console.WriteLine("Subkeys of " + rKey.get_Name()); Console.WriteLine("-----------------------------------------------"); // Print the contents of the array to the console. String s = null; for (int iCtr = 0; iCtr < names.get_Length(); iCtr++) { s = names[iCtr]; Console.WriteLine(s); // The following code puts a limit on the number // of keys displayed. Comment it out to print the // complete list. iCount++; if (iCount >= 10) { break; } } } //PrintKeys } //Reg

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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


- Registry.DynData フィールドのページへのリンク