HostingEnvironment.ApplicationPhysicalPath プロパティ

定義

アプリケーションのディレクトリへのディスク上の物理パスを取得します。

public:
 static property System::String ^ ApplicationPhysicalPath { System::String ^ get(); };
public static string ApplicationPhysicalPath { get; }
static member ApplicationPhysicalPath : string
Public Shared ReadOnly Property ApplicationPhysicalPath As String

プロパティ値

アプリケーションのディレクトリへのディスク上の物理パス。

次のコード例では、 プロパティを ApplicationPhysicalPath 使用して、アプリケーションの App_Data ディレクトリ内のデータ ファイルへのパスを作成します。 この例を実行するために必要な完全なコードについては、クラスの概要に関するトピックの「例」セクションを VirtualPathProvider 参照してください。

// Set the datafile path relative to the application's path.
dataFile = HostingEnvironment.ApplicationPhysicalPath + "App_Data\\XMLData.xml";
' Set the datafile path relative to the application's path.
dataFile = HostingEnvironment.ApplicationPhysicalPath & _
  "App_Data\XMLData.xml"

適用対象