Proprietà Document.Path
ottiene il percorso, senza nome file, per la directory che contiene il documento.
Spazio dei nomi: EnvDTE
Assembly: EnvDTE (in EnvDTE.dll)
Sintassi
'Dichiarazione
ReadOnly Property Path As String
string Path { get; }
property String^ Path {
String^ get ();
}
abstract Path : string
function get Path () : String
Valore proprietà
Tipo: System.String
Stringa che rappresenta il percorso, senza nome file, per la directory che contiene il documento.
Note
Il percorso restituito non include il nome file o estensione.Ad esempio, se il percorso del documento è C#: \MsDev\Projects\MyProject \ stdafx.cpp, quindi Path restituisce la stringa, C#: \MsDev\Projects\MyProject.Non esiste una barra rovesciata finale a meno che il percorso sia la radice di un dispositivo, ad esempio C:\.
Esempi
Sub PathExample()
Dim doc As Document
Dim desc As String
Set doc = DTE.ActiveDocument
desc = "You are editing a "
If (doc.ReadOnly) Then
desc = desc & "read-only"
Else
desc = desc & "writable"
End If
desc = desc & " document called " & doc.Name & " located at " & doc.Path
MsgBox desc
End Sub
Sicurezza di .NET Framework
- Attendibilità totale per il chiamante immediato. Impossibile utilizzare questo membro in codice parzialmente attendibile. Per ulteriori informazioni, vedere Utilizzo di librerie da codice parzialmente attendibile.