Freigeben über


XmlConvert.ToUInt16-Methode

Konvertiert die String in ein UInt16-Äquivalent.

Diese Methode ist nicht CLS-kompatibel.  

Namespace: System.Xml
Assembly: System.Xml (in system.xml.dll)

Syntax

'Declaration
<CLSCompliantAttribute(False)> _
Public Shared Function ToUInt16 ( _
    s As String _
) As UShort
'Usage
Dim s As String
Dim returnValue As UShort

returnValue = XmlConvert.ToUInt16(s)
[CLSCompliantAttribute(false)] 
public static ushort ToUInt16 (
    string s
)
[CLSCompliantAttribute(false)] 
public:
static unsigned short ToUInt16 (
    String^ s
)
/** @attribute CLSCompliantAttribute(false) */ 
public static UInt16 ToUInt16 (
    String s
)
CLSCompliantAttribute(false) 
public static function ToUInt16 (
    s : String
) : ushort

Parameter

  • s
    Die zu konvertierende Zeichenfolge.

Rückgabewert

Ein UInt16-Äquivalent der Zeichenfolge.

Ausnahmen

Ausnahmetyp Bedingung

ArgumentNullException

s ist NULL (Nothing in Visual Basic).

FormatException

s weist nicht das richtige Format auf.

OverflowException

s stellt eine Zahl dar, die kleiner als UInt16.MinValue oder größer als UInt16.MaxValue ist.

Plattformen

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile für Pocket PC, Windows Mobile für Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen.

Versionsinformationen

.NET Framework

Unterstützt in: 2.0, 1.1, 1.0

.NET Compact Framework

Unterstützt in: 2.0, 1.0

Siehe auch

Referenz

XmlConvert-Klasse
XmlConvert-Member
System.Xml-Namespace