Sdílet prostřednictvím


XDeclaration.Version Vlastnost

Definice

Získá nebo nastaví vlastnost verze pro tento dokument.

public:
 property System::String ^ Version { System::String ^ get(); void set(System::String ^ value); };
public string Version { get; set; }
public string? Version { get; set; }
member this.Version : string with get, set
Public Property Version As String

Hodnota vlastnosti

Obsahující String vlastnost verze pro tento dokument.

Příklady

Následující příklad používá tuto vlastnost k tisku vlastnosti verze deklarace.

XDeclaration xd = new XDeclaration("1.0", "utf-8", "yes");
Console.WriteLine(xd.Version);
Console.WriteLine(xd.Encoding);
Console.WriteLine(xd.Standalone);
Dim xd As XDeclaration = New XDeclaration("1.0", "utf-8", "yes")
Console.WriteLine(xd.Version)
Console.WriteLine(xd.Encoding)
Console.WriteLine(xd.Standalone)

Tento příklad vytvoří následující výstup:

1.0
utf-8
yes

Poznámky

Hodnota je obvykle 1,0. Tato hodnota se nevynucuje.

Platí pro

Viz také