SerializationInfo.GetUInt64(String) 方法

定义

重要

此 API 不符合 CLS。

SerializationInfo 存储中检索一个 64 位无符号整数值。

C#
[System.CLSCompliant(false)]
public ulong GetUInt64 (string name);

参数

name
String

与要检索的值关联的名称。

返回

name 关联的 64 位无符号整数。

属性

例外

namenull

name 关联的值不能转换为 64 位无符号整数。

当前实例中没有找到具有指定名称的元素。

注解

如果值是 64 位无符号整数,或者可以转换为 1,则返回该值;否则, InvalidCastException 将引发 。 所有转换都由 IFormatterConverter 与此 SerializationInfo关联的 完成。

适用于

产品 版本
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1