AppDomain.AppendPrivatePathとは? わかりやすく解説

AppDomain.AppendPrivatePath メソッド

メモ : このメソッドは、互換性のために残されています。

指定したディレクトリ名をプライベート パス追加します

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

<ObsoleteAttribute("AppDomain.AppendPrivatePath has been deprecated.
 Please investigate the use of AppDomainSetup.PrivateBinPath instead. http://go.microsoft.com/fwlink/?linkid=14202")>
 _
Public Sub AppendPrivatePath ( _
    path As String _
)
Dim instance As AppDomain
Dim path As String

instance.AppendPrivatePath(path)
[ObsoleteAttribute("AppDomain.AppendPrivatePath has been deprecated. Please
 investigate the use of AppDomainSetup.PrivateBinPath instead. http://go.microsoft.com/fwlink/?linkid=14202")]
 
public void AppendPrivatePath (
    string path
)
[ObsoleteAttribute(L"AppDomain.AppendPrivatePath has been deprecated. Please
 investigate the use of AppDomainSetup.PrivateBinPath instead. http://go.microsoft.com/fwlink/?linkid=14202")]
 
public:
virtual void AppendPrivatePath (
    String^ path
) sealed
/** @attribute ObsoleteAttribute("AppDomain.AppendPrivatePath has been deprecated.
 Please investigate the use of AppDomainSetup.PrivateBinPath instead. http://go.microsoft.com/fwlink/?linkid=14202")
 */ 
public final void AppendPrivatePath (
    String path
)
ObsoleteAttribute("AppDomain.AppendPrivatePath has been deprecated. Please investigate
 the use of AppDomainSetup.PrivateBinPath instead. http://go.microsoft.com/fwlink/?linkid=14202")
 
public final function AppendPrivatePath (
    path : String
)

パラメータ

path

プライベート パス追加するディレクトリ名。

例外例外
解説解説
使用例使用例
Imports System
Imports System.Reflection
Imports System.Security.Policy
Imports System.Security.Permissions

Class ADAppendPrivatePath
   <SecurityPermission(SecurityAction.Demand, Flags:=SecurityPermissionFlag.ControlAppDomain),
 _
    SecurityPermission(SecurityAction.Demand, Flags:=SecurityPermissionFlag.ControlEvidence)>
 _
   Public Shared Sub Example()

      'Create evidence for the new appdomain.
      Dim adevidence As Evidence = AppDomain.CurrentDomain.Evidence

      'Create a setup object for the new application domain.
      Dim setup As New AppDomainSetup()

      'Append the relative path
      setup.PrivateBinPath = "www.code.microsoft.com"

      Dim domain As AppDomain = _
          AppDomain.CreateDomain("MyDomain", adevidence,
 setup)
      
      'Display the new relative search path
      Console.WriteLine("Relative search path is: "
 _
          & domain.RelativeSearchPath)
      
      AppDomain.Unload(domain)

   End Sub

   Public Shared Sub Main()
      Example()
   End Sub 
End Class 
using System;
using System.Reflection;
using System.Security.Policy;
using System.Security.Permissions;

class ADAppendPrivatePath
{
   [SecurityPermission(SecurityAction.Demand, Flags=SecurityPermissionFlag.ControlAppDomain)
,
    SecurityPermission(SecurityAction.Demand, Flags=SecurityPermissionFlag.ControlEvidence)]
   public static void Example()
   {
      //Create evidence for new appdomain.
      Evidence adevidence = AppDomain.CurrentDomain.Evidence;

      //Create a setup object for the new application domain.
      AppDomainSetup setup = new AppDomainSetup();

      //Append the relative path
      setup.PrivateBinPath = "www.code.microsoft.com";

      AppDomain domain = 
          AppDomain.CreateDomain("MyDomain", adevidence, setup);

      //display the new relative search path
      Console.WriteLine("Relative search path is: " 
         + domain.RelativeSearchPath);
 
      AppDomain.Unload(domain);   
   }
   public static void Main()
   {
      Example();
   }
}
using namespace System;
using namespace System::Reflection;
using namespace System::Security::Policy;
int main()
{
   
   //Create evidence for new appdomain.
   Evidence^ adevidence = AppDomain::CurrentDomain->Evidence;
   
   //Create the new application domain.
   AppDomain^ domain = AppDomain::CreateDomain( "MyDomain", adevidence
 );
   
   //Display the current relative search path.
   Console::WriteLine( "Relative search path is: {0}", domain->RelativeSearchPath
 );
   
   //Append the relative path
   String^ Newpath = "www.code.microsoft.com";
   domain->AppendPrivatePath( Newpath );
   
   //display the new relative search path
   Console::WriteLine( "Relative search path is: {0}", domain->RelativeSearchPath
 );
   AppDomain::Unload( domain );
}

import System.*;
import System.Reflection.*;
import System.Security.Policy.*;
import System.Security.Permissions.*;

class ADAppendPrivatePath
{
    /** @attribute SecurityPermissionAttribute( SecurityAction.Demand, ControlAppDomain
 = true )
     */
    public static void main(String[]
 args)
    {
        //Create evidence for new appdomain.
        Evidence adEvidence = AppDomain.get_CurrentDomain().get_Evidence();

        //Create the new application domain.
        AppDomain domain = AppDomain.CreateDomain("MyDomain", adEvidence);

        //Display the current relative search path.
        Console.WriteLine("Relative search path is: " 
            + domain.get_RelativeSearchPath());

        //Append the relative path
        String newPath = "www.code.microsoft.com";
        domain.AppendPrivatePath(newPath);

        //display the new relative search path
        Console.WriteLine("Relative search path is: " 
            + domain.get_RelativeSearchPath());
        AppDomain.Unload(domain);
    } //main
} //ADAppendPrivatePat
.NET Framework のセキュリティ.NET Frameworkセキュリティ
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

_AppDomain.AppendPrivatePath メソッド




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

辞書ショートカット

すべての辞書の索引

「AppDomain.AppendPrivatePath」の関連用語

AppDomain.AppendPrivatePathのお隣キーワード
検索ランキング

   

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



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

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

©2025 GRAS Group, Inc.RSS