RuntimeEnvironmentとは? わかりやすく解説

RuntimeEnvironment クラス

共通言語ランタイム環境に関する情報返す static メソッドコレクション提供します

名前空間: System.Runtime.InteropServices
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

<ComVisibleAttribute(True)> _
Public Class RuntimeEnvironment
Dim instance As RuntimeEnvironment
[ComVisibleAttribute(true)] 
public class RuntimeEnvironment
[ComVisibleAttribute(true)] 
public ref class RuntimeEnvironment
/** @attribute ComVisibleAttribute(true) */ 
public class RuntimeEnvironment
ComVisibleAttribute(true) 
public class RuntimeEnvironment
使用例使用例

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.Object
  System.Runtime.InteropServices.RuntimeEnvironment
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
RuntimeEnvironment メンバ
System.Runtime.InteropServices 名前空間

RuntimeEnvironment コンストラクタ


RuntimeEnvironment プロパティ


パブリック プロパティパブリック プロパティ

  名前 説明
パブリック プロパティ SystemConfigurationFile システム構成ファイルへのパス取得します
参照参照

関連項目

RuntimeEnvironment クラス
System.Runtime.InteropServices 名前空間

RuntimeEnvironment メソッド


パブリック メソッドパブリック メソッド

プロテクト メソッドプロテクト メソッド
参照参照

関連項目

RuntimeEnvironment クラス
System.Runtime.InteropServices 名前空間

RuntimeEnvironment メンバ

共通言語ランタイム環境に関する情報返す static メソッドコレクション提供します

RuntimeEnvironment データ型公開されるメンバを以下の表に示します


パブリック コンストラクタパブリック コンストラクタ
  名前 説明
パブリック メソッド RuntimeEnvironment  
パブリック プロパティパブリック プロパティ
  名前 説明
パブリック プロパティ SystemConfigurationFile システム構成ファイルへのパス取得します
パブリック メソッドパブリック メソッド
プロテクト メソッドプロテクト メソッド
参照参照

関連項目

RuntimeEnvironment クラス
System.Runtime.InteropServices 名前空間


このページでは「.NET Framework クラス ライブラリ リファレンス」からRuntimeEnvironmentを検索した結果を表示しています。
Weblioに収録されているすべての辞書からRuntimeEnvironmentを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からRuntimeEnvironment を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「RuntimeEnvironment」の関連用語

RuntimeEnvironmentのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



RuntimeEnvironmentのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS