Assembly.CodeBaseとは? わかりやすく解説

Assembly.CodeBase プロパティ

アセンブリの場所を初めに指定されたとおりに取得します。たとえば、AssemblyName オブジェクトなどがあります

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

例外例外
解説解説
使用例使用例

CodeBase プロパティ使用する式を次の例に示します

    Dim SampleAssembly As [Assembly]
    ' Instantiate a target object.
    Dim Integer1 As New
 Int32()
    Dim Type1 As Type
    ' Set the Type instance to the target class type.
    Type1 = Integer1.GetType()
    ' Instantiate an Assembly class to the assembly housing the Integer
 type.  
    SampleAssembly = [Assembly].GetAssembly(Integer1.GetType())
    ' Gets the location of the assembly using file: protocol.
    Console.WriteLine(("CodeBase=" + SampleAssembly.CodeBase))
End Sub
Assembly SampleAssembly;
// Instantiate a target object.
Int32 Integer1 = new Int32();
Type Type1;
// Set the Type instance to the target class type.
Type1 = Integer1.GetType();
// Instantiate an Assembly class to the assembly housing the Integer
 type.  
SampleAssembly = Assembly.GetAssembly(Integer1.GetType());
// Gets the location of the assembly using file: protocol.
Console.WriteLine("CodeBase=" + SampleAssembly.CodeBase);
Assembly^ SampleAssembly;
// Instantiate a target object.
Int32 Integer1(0);
Type^ Type1;
// Set the Type instance to the target class type.
Type1 = Integer1.GetType();
// Instantiate an Assembly class to the assembly housing the Integer
 type.  
SampleAssembly = Assembly::GetAssembly( Integer1.GetType() );
// Gets the location of the assembly using file: protocol.
Console::WriteLine( "CodeBase= {0}", SampleAssembly->CodeBase );
var SampleAssembly : Assembly;
// Instantiate a target object.
var Integer1 : Int32 = 0;
var Type1 : Type;
// Set the Type instance to the target class type.
Type1 = Integer1.GetType();
// Instantiate an Assembly class to the assembly housing the Integer
 type.  
SampleAssembly = Assembly.GetAssembly(Integer1.GetType());
// Gets the location of the assembly using file: protocol.
Console.WriteLine("CodeBase=" + SampleAssembly.CodeBase);
.NET Framework のセキュリティ.NET Frameworkセキュリティ
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

_Assembly.CodeBase プロパティ

メモ : このプロパティは、.NET Framework version 2.0新しく追加されたものです。

COM オブジェクトに、Assembly.CodeBase プロパティへのバージョン依存しないアクセス用意されています。

このプロパティは、CLS準拠していません。  

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

解説解説

このメソッドは、アンマネージ コードからマネージ クラスアクセスするためのメソッドであるため、マネージ コードからは呼び出さないください

Assembly.CodeBase プロパティは、アセンブリの場所を初めに指定されたとおりに取得します。たとえば、AssemblyName オブジェクトなどがあります

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
_Assembly インターフェイス
_Assembly メンバ
System.Runtime.InteropServices 名前空間
Assembly.CodeBase



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

辞書ショートカット

すべての辞書の索引

「Assembly.CodeBase」の関連用語

Assembly.CodeBaseのお隣キーワード
検索ランキング

   

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



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

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

©2025 GRAS Group, Inc.RSS