XNamespace.Get(String) Metodo
Definizione
Importante
Alcune informazioni sono relative alla release non definitiva del prodotto, che potrebbe subire modifiche significative prima della release definitiva. Microsoft non riconosce alcuna garanzia, espressa o implicita, in merito alle informazioni qui fornite.
Ottiene un oggetto XNamespace per l'URI (Uniform Resource Identifier) specificato.
public:
static System::Xml::Linq::XNamespace ^ Get(System::String ^ namespaceName);
public static System.Xml.Linq.XNamespace Get(string namespaceName);
static member Get : string -> System.Xml.Linq.XNamespace
Public Shared Function Get (namespaceName As String) As XNamespace
Parametri
Valori restituiti
Oggetto XNamespace creato dall'URI specificato.
Esempio
Nell'esempio seguente viene ottenuto un XNamespace oggetto da un URI specificato.
XNamespace aw = XNamespace.Get("http://www.adventure-works.com");
// This is the preferred form.
XNamespace aw2 = "http://www.adventure-works.com";
Console.WriteLine(aw);
Console.WriteLine(aw2);
Imports <xmlns:aw="http://www.adventure-works.com">
Module Module1
Sub Main()
Dim aw As XNamespace = XNamespace.Get("http://www.adventure-works.com")
' This is the preferred form.
Dim aw2 As XNamespace = GetXmlNamespace(aw)
Console.WriteLine(aw)
Console.WriteLine(aw2)
End Sub
End Module
In questo esempio viene generato l'output seguente:
http://www.adventure-works.com
http://www.adventure-works.com
Commenti
L'oggetto restituito è garantito che sia atomico XNamespace , ovvero è l'unico nel sistema per quel particolare URI.