XName.NamespaceName Properti

Definisi

Mengembalikan URI untuk XNamespace ini XName.

public:
 property System::String ^ NamespaceName { System::String ^ get(); };
public string NamespaceName { get; }
member this.NamespaceName : string
Public ReadOnly Property NamespaceName As String

Nilai Properti

URI untuk XNamespace ini XName.

Contoh

Contoh ini membuat elemen di namespace, lalu mencetak namespace elemen.

XNamespace aw = "http://www.adventure-works.com";
XElement root = new XElement(aw + "Root");
Console.WriteLine(root.Name.NamespaceName);
Imports <xmlns="http://www.adventure-works.com">

Module Module1
    Sub Main()
        Dim root As XElement = <Root/>
        Console.WriteLine(root.Name.NamespaceName)
    End Sub
End Module

Contoh ini menghasilkan output berikut:

http://www.adventure-works.com

Keterangan

Ini adalah properti kenyamanan untuk mendapatkan nama namespace dari XName.

Berlaku untuk

Lihat juga