AppDomain.GetData メソッド
アセンブリ: mscorlib (mscorlib.dll 内)

Dim instance As AppDomain Dim name As String Dim returnValue As Object returnValue = instance.GetData(name)
- name
あらかじめ定義されたアプリケーション ドメイン プロパティの名前、または独自に定義したアプリケーション ドメイン プロパティの名前。
name プロパティの値。


このメソッドを使用すると、AppDomain のこのインスタンスのプロパティを記述している名前とデータの組み合わせの内部キャッシュ内のエントリの値を取得できます。
キャッシュには、アプリケーション ドメインの作成時に挿入される定義済みのシステム エントリが自動的に格納されます。この値は、GetData メソッドまたは同等の AppDomainSetup のプロパティを使用して検査できます。
独自のユーザー定義の名前とデータの組み合わせを挿入または編集するには、SetData メソッドを使用し、その値を検査するには、GetData メソッドを使用します。
定義済みの各システム エントリの name とそれに対応する AppDomainSetup プロパティの一覧を次の表に示します。
name の値 | |
---|---|
"APPBASE" | |
"LOADER_OPTIMIZATION" | LoaderOptimization |
"APP_CONFIG_FILE" | |
"DYNAMIC_BASE" | DynamicBase |
"DEV_PATH" | (プロパティなし) |
"APP_NAME" | ApplicationName |
"PRIVATE_BINPATH" | PrivateBinPath |
"BINPATH_PROBE_ONLY" | PrivateBinPathProbe |
"SHADOW_COPY_DIRS" | ShadowCopyDirectories |
"FORCE_CACHE_INSTALL" | ShadowCopyFiles |
"CACHE_BASE" | CachePath |
LicenseFile |

Imports System Imports System.Reflection Class ADGetData Public Shared Sub Main() ' appdomain setup information Dim currentDomain As AppDomain = AppDomain.CurrentDomain 'set predefined system variable application name Dim dataName As [String] = "APP_NAME" Dim setappname As [String] = "MyApplication" currentDomain.SetData(dataName, setappname) 'Create a new value pair for the appdomain Dim dataValue As [String] = "ADVALUE" Dim advalue As Int32 = 6 currentDomain.SetData(dataValue, advalue) 'get the value specified in the setdata method Console.WriteLine((" ADVALUE is: " + currentDomain.GetData("ADVALUE"))) 'get system value specified at appdomainsetup Console.WriteLine(("System value for application name:" + currentDomain.GetData("APP_NAME"))) End Sub 'Main End Class 'ADGetData
using System; using System.Reflection; class ADGetData { public static void Main() { // appdomain setup information AppDomain currentDomain = AppDomain.CurrentDomain; //set predefined system variable application name String dataName = "APP_NAME"; String setappname = "MyApplication"; currentDomain.SetData(dataName, setappname); //Create a new value pair for the appdomain String dataValue = "ADVALUE"; Int32 advalue = 6; currentDomain.SetData(dataValue, advalue); //get the value specified in the setdata method Console.WriteLine(" ADVALUE is: " + currentDomain.GetData("ADVALUE")); //get system value specified at appdomainsetup Console.WriteLine("System value for application name:" + currentDomain.GetData("APP_NAME")); } }
using namespace System; using namespace System::Reflection; int main() { // appdomain setup information AppDomain^ currentDomain = AppDomain::CurrentDomain; //set predefined system variable application name String^ dataName = "APP_NAME"; String^ setappname = "MyApplication"; currentDomain->SetData( dataName, setappname ); //Create a new value pair for the appdomain String^ dataValue = "ADVALUE"; Int32 advalue = 6; currentDomain->SetData( dataValue, advalue ); //get the value specified in the setdata method Console::WriteLine( " ADVALUE is: {0}", currentDomain->GetData( "ADVALUE" ) ); //get system value specified at appdomainsetup Console::WriteLine( "System value for application name: {0}", currentDomain->GetData( "APP_NAME" ) ); }


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


_AppDomain.GetData メソッド
アセンブリ: mscorlib (mscorlib.dll 内)

Dim instance As _AppDomain Dim name As String Dim returnValue As Object returnValue = instance.GetData(name)


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


- AppDomain.GetDataのページへのリンク