XmlConvert.ToUInt16(String) 方法

定义

重要

此 API 不符合 CLS。

String 转换为等效的 UInt16Converts the String to a UInt16 equivalent.

public:
 static System::UInt16 ToUInt16(System::String ^ s);
[System.CLSCompliant(false)]
public static ushort ToUInt16 (string s);
[<System.CLSCompliant(false)>]
static member ToUInt16 : string -> uint16
Public Shared Function ToUInt16 (s As String) As UShort

参数

s
String

要转换的字符串。The string to convert.

返回

UInt16

与该字符串等效的 UInt16A UInt16 equivalent of the string.

属性

例外

snulls is null.

s 的格式不正确。s is not in the correct format.

s 表示一个小于 MinValue 或大于 MaxValue 的数字。s represents a number less than MinValue or greater than MaxValue.

适用于