HostingEnvironment.ApplicationPhysicalPath Properti
Definisi
Penting
Beberapa informasi terkait produk prarilis yang dapat diubah secara signifikan sebelum dirilis. Microsoft tidak memberikan jaminan, tersirat maupun tersurat, sehubungan dengan informasi yang diberikan di sini.
Mendapatkan jalur fisik pada disk ke direktori aplikasi.
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
Nilai Properti
Jalur fisik pada disk ke direktori aplikasi.
Contoh
Contoh kode berikut menggunakan ApplicationPhysicalPath properti untuk membuat jalur ke file data di direktori App_Data aplikasi. Untuk kode lengkap yang diperlukan untuk menjalankan contoh, lihat bagian VirtualPathProvider Contoh dari topik gambaran umum kelas.
// 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"