XDeclaration.Version 属性 
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取或设置此文档的版本属性。
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, setPublic Property Version As String属性值
一个包含此文档的版本属性的 String。
示例
以下示例使用此属性打印声明的版本属性。
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)  
该示例产生下面的输出:
1.0  
utf-8  
yes  
注解
该值通常是“1.0”。 不强制使用此值。