HostingEnvironment.ApplicationPhysicalPath Propriété
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Obtient le chemin d’accès physique sur disque au répertoire de l’application.
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
Valeur de propriété
Chemin d'accès physique sur disque au répertoire de l'application.
Exemples
L’exemple de code suivant utilise la ApplicationPhysicalPath propriété pour construire un chemin d’accès à un fichier de données dans le répertoire App_Data de l’application. Pour obtenir le code complet requis pour exécuter l’exemple, consultez la section Exemple de la rubrique Vue d’ensemble de la VirtualPathProvider classe.
// 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"
S’applique à
Commentaires
https://aka.ms/ContentUserFeedback.
Bientôt disponible : Tout au long de 2024, nous allons supprimer progressivement GitHub Issues comme mécanisme de commentaires pour le contenu et le remplacer par un nouveau système de commentaires. Pour plus d’informations, consultezEnvoyer et afficher des commentaires pour