Export (0) Print
Expand All
1 out of 1 rated this helpful - Rate this topic

UInt16.MaxValue Field

Represents the largest possible value of UInt16. This field is constant.

This field is not CLS-compliant.  

Namespace: System
Assembly: mscorlib (in mscorlib.dll)

public const ushort MaxValue
public static final UInt16 MaxValue
public const var MaxValue : ushort
Not applicable.

The value of this constant is 65535; that is, hexadecimal 0xFFFF.

The following example uses the MaxValue and MinValue properties to ensure that an Int32 value is in the range of the UInt16 type before converting it to a UInt16 value. This prevents the conversion operation from throwing an OverflowException if the integer value is not in the range of the UInt16 type.

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

.NET Compact Framework

Supported in: 2.0, 1.0

XNA Framework

Supported in: 1.0
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.