RuntimeEnvironment クラス
アセンブリ: mscorlib (mscorlib.dll 内)


RuntimeEnvironment クラスによって定義される多数のメソッドを呼び出す方法を次の例に示します。
using System; using System.Reflection; using System.Runtime.InteropServices; public sealed class App { static void Main() { // Show whether the EXE assembly was loaded from the GAC or from a private subdirectory. Console.WriteLine("Did the {0} assembly load from the GAC? {1}" , Assembly.GetExecutingAssembly(), RuntimeEnvironment.FromGlobalAccessCache(Assembly.GetExecutingAssembly())); // Show the path where the CLR was loaded from. Console.WriteLine("Runtime directory: {0}", RuntimeEnvironment.GetRuntimeDirectory()); // Show the CLR's version number. Console.WriteLine("System version: {0}", RuntimeEnvironment.GetSystemVersion()); // Show the path of the machine's configuration file. Console.WriteLine("System configuration file: {0}", RuntimeEnvironment.SystemConfigurationFile); } } // This code produces the following output. // // Did the RuntimeEnvironment, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null // assembly load from the GAC? False // Runtime directory: C:\WINDOWS\Microsoft.NET\Framework\v2.0.40607\ // System version: v2.0.40607 // System configuration file: C:\WINDOWS\Microsoft.NET\Framework\v2.0.40607\config\ // machine.config
using namespace System; using namespace System::Reflection; using namespace System::Runtime::InteropServices; int main() { // Show whether the EXE assembly was loaded from the GAC or from a // private subdirectory. Console::WriteLine("Did the {0} assembly load from the GAC? {1}", Assembly::GetExecutingAssembly(), RuntimeEnvironment::FromGlobalAccessCache( Assembly::GetExecutingAssembly())); // Show the path where the CLR was loaded from. Console::WriteLine("Runtime directory: {0}", RuntimeEnvironment::GetRuntimeDirectory()); // Show the CLR's version number. Console::WriteLine("System version: {0}", RuntimeEnvironment::GetSystemVersion()); // Show the path of the machine's configuration file. Console::WriteLine("System configuration file: {0}", RuntimeEnvironment::SystemConfigurationFile); } // This code produces the following output. // // Did the RuntimeEnvironment, Version=0.0.0.0, Culture=neutral, // PublicKeyToken=null // assembly load from the GAC? False // Runtime directory: C:\WINDOWS\Microsoft.NET\Framework\v2.0.40607\ // System version: v2.0.40607 // System configuration file: // C:\WINDOWS\Microsoft.NET\Framework\v2.0.40607\config\machine.config

System.Runtime.InteropServices.RuntimeEnvironment


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


RuntimeEnvironment コンストラクタ
アセンブリ: mscorlib (mscorlib.dll 内)


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


RuntimeEnvironment プロパティ
RuntimeEnvironment メソッド

名前 | 説明 | |
---|---|---|
![]() | Equals | オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 ( Object から継承されます。) |
![]() | FromGlobalAccessCache | 指定したアセンブリがグローバル アセンブリ キャッシュ (GAC) に読み込まれているかどうかをテストします。 |
![]() | GetHashCode | 特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 ( Object から継承されます。) |
![]() | GetRuntimeDirectory | 共通言語ランタイムがインストールされているディレクトリを取得します。 |
![]() | GetSystemVersion | 現在のプロセスを実行している共通言語ランタイムのバージョン番号を取得します。 |
![]() | GetType | 現在のインスタンスの Type を取得します。 ( Object から継承されます。) |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 ( Object から継承されます。) |
![]() | ToString | 現在の Object を表す String を返します。 ( Object から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 ( Object から継承されます。) |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 ( Object から継承されます。) |

RuntimeEnvironment メンバ
共通言語ランタイム環境に関する情報を返す static メソッドのコレクションを提供します。
RuntimeEnvironment データ型で公開されるメンバを以下の表に示します。

名前 | 説明 | |
---|---|---|
![]() | RuntimeEnvironment |


名前 | 説明 | |
---|---|---|
![]() | Equals | オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 (Object から継承されます。) |
![]() | FromGlobalAccessCache | 指定したアセンブリがグローバル アセンブリ キャッシュ (GAC) に読み込まれているかどうかをテストします。 |
![]() | GetHashCode | 特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 (Object から継承されます。) |
![]() | GetRuntimeDirectory | 共通言語ランタイムがインストールされているディレクトリを取得します。 |
![]() | GetSystemVersion | 現在のプロセスを実行している共通言語ランタイムのバージョン番号を取得します。 |
![]() | GetType | 現在のインスタンスの Type を取得します。 (Object から継承されます。) |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 (Object から継承されます。) |
![]() | ToString | 現在の Object を表す String を返します。 (Object から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 (Object から継承されます。) |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 (Object から継承されます。) |

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

- RuntimeEnvironmentのページへのリンク