System.UInt16 Structure

Represents a 16-bit unsigned integer.

See Also: UInt16 Members

Syntax

[System.CLSCompliant(false)]
[System.Runtime.InteropServices.ComVisible(true)]
public struct UInt16 : IComparable, IComparable<ushort>, IConvertible, IEquatable<ushort>, IFormattable

Remarks

The ushort value type represents unsigned integers with values ranging from 0 to 65535.

Note:

   The ushort type is not CLS-compliant. The CLS-compliant alternative type is int. short can be used instead to replace a ushort value that ranges from zero to short.MaxValue. For more information about CLS compliance, see Common Language Specification.

The ushort structure provides methods to compare instances of this type, convert the value of an instance to its string representation, and convert the string representation of a number to an instance of this type.

For information about how format specification codes control the string representation of value types, see [<topic://cpConFormattingOverview>].

Thread Safety

This type is safe for multithreaded operations.

Requirements

Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0