# Int16 结构

## 定义

``public value class Int16 : IComparable, IComparable<short>, IConvertible, IEquatable<short>, IFormattable``
``public struct Int16 : IComparable, IComparable<short>, IConvertible, IEquatable<short>, IFormattable``
``````[System.Serializable]
public struct Int16 : IComparable, IComparable<short>, IConvertible, IEquatable<short>, IFormattable``````
``````[System.Runtime.InteropServices.ComVisible(true)]
[System.Serializable]
public struct Int16 : IComparable, IComparable<short>, IConvertible, IEquatable<short>, IFormattable``````
``````type int16 = struct
interface IFormattable
interface IConvertible``````
``````Public Structure Int16
Implements IComparable, IComparable(Of Short), IConvertible, IEquatable(Of Short), IFormattable``````

## 注解

Int16 值类型表示其值范围从负32768到正32767的带符号整数。The Int16 value type represents signed integers with values ranging from negative 32768 through positive 32767.

## 字段

 表示 Int16 的最大可能值。Represents the largest possible value of an Int16. 此字段是常量。This field is constant. 表示 Int16 的最小可能值。Represents the smallest possible value of Int16. 此字段是常量。This field is constant.

## 方法

 将此实例与指定的 16 位有符号整数进行比较，并返回一个整数，该整数指示此实例的值是小于、等于还是大于指定的 16 位有符号整数的值。Compares this instance to a specified 16-bit signed integer and returns an integer that indicates whether the value of this instance is less than, equal to, or greater than the value of the specified 16-bit signed integer. 将此实例与指定对象进行比较，并返回一个整数，该整数指示此实例的值是小于、等于还是大于此对象的值。Compares this instance to a specified object and returns an integer that indicates whether the value of this instance is less than, equal to, or greater than the value of the object. 返回一个值，该值指示此实例是否等于指定的 Int16 值。Returns a value indicating whether this instance is equal to a specified Int16 value. 返回一个值，该值指示此实例是否等于指定对象。Returns a value indicating whether this instance is equal to a specified object. 返回此实例的哈希代码。Returns the hash code for this instance. 返回值类型 TypeCode 的 Int16。Returns the TypeCode for value type Int16. 将指定样式和区域性特定格式的数字的范围表示形式转换为它的等效 16 位带符号整数。Converts the span representation of a number in a specified style and culture-specific format to its 16-bit signed integer equivalent. 将数字的字符串表示形式转换为它的等效 16 位有符号整数。Converts the string representation of a number to its 16-bit signed integer equivalent. 将指定的区域性特定格式的数字的字符串表示形式转换为它的等效 16 位有符号整数。Converts the string representation of a number in a specified culture-specific format to its 16-bit signed integer equivalent. 将指定样式的数字的字符串表示形式转换为它的等效 16 位有符号整数。Converts the string representation of a number in a specified style to its 16-bit signed integer equivalent. 将指定样式和区域性特定格式的数字的字符串表示形式转换为它的等效 16 位有符号整数。Converts the string representation of a number in a specified style and culture-specific format to its 16-bit signed integer equivalent. 将此实例的数值转换为其等效的字符串表示形式。Converts the numeric value of this instance to its equivalent string representation. 使用指定的区域性特定格式信息，将此实例的数值转换为它的等效字符串表示形式。Converts the numeric value of this instance to its equivalent string representation using the specified culture-specific format information. 使用指定的格式，将此实例的数值转换为它的等效字符串表示形式。Converts the numeric value of this instance to its equivalent string representation, using the specified format. 使用指定的格式和区域性特定格式设置信息，将此实例的数值转换为其等效字符串表示形式。Converts the numeric value of this instance to its equivalent string representation using the specified format and culture-specific formatting information. 尝试将当前短数字实例的值的格式设置为提供的字符范围。Tries to format the value of the current short number instance into the provided span of characters. 将指定样式和区域性特定格式的数字的范围表示形式转换为它的等效 16 位带符号整数。Converts the span representation of a number in a specified style and culture-specific format to its 16-bit signed integer equivalent. 一个指示转换是否成功的返回值。A return value indicates whether the conversion succeeded or failed. 将指定样式和区域性特定格式的数字的范围表示形式转换为它的等效 16 位带符号整数。Converts the span representation of a number in a specified style and culture-specific format to its 16-bit signed integer equivalent. 一个指示转换是否成功的返回值。A return value indicates whether the conversion succeeded or failed. 将数字的字符串表示形式转换为它的等效 16 位有符号整数。Converts the string representation of a number to its 16-bit signed integer equivalent. 一个指示转换是否成功的返回值。A return value indicates whether the conversion succeeded or failed. 将指定样式和区域性特定格式的数字的字符串表示形式转换为它的等效 16 位有符号整数。Converts the string representation of a number in a specified style and culture-specific format to its 16-bit signed integer equivalent. 一个指示转换是否成功的返回值。A return value indicates whether the conversion succeeded or failed.

## 显式接口实现

 将此实例与指定对象进行比较，并返回一个整数，该整数指示此实例的值是小于、等于还是大于此对象的值。Compares this instance to a specified object and returns an integer that indicates whether the value of this instance is less than, equal to, or greater than the value of the object. 返回值类型 TypeCode 的 Int16。Returns the TypeCode for value type Int16. 有关此成员的说明，请参见 ToBoolean(IFormatProvider)。For a description of this member, see ToBoolean(IFormatProvider). 有关此成员的说明，请参见 ToByte(IFormatProvider)。For a description of this member, see ToByte(IFormatProvider). 有关此成员的说明，请参见 ToChar(IFormatProvider)。For a description of this member, see ToChar(IFormatProvider). 不支持此转换。This conversion is not supported. 尝试使用此方法将引发 InvalidCastException。Attempting to use this method throws an InvalidCastException. 有关此成员的说明，请参见 ToDecimal(IFormatProvider)。For a description of this member, see ToDecimal(IFormatProvider). 有关此成员的说明，请参见 ToDouble(IFormatProvider)。For a description of this member, see ToDouble(IFormatProvider). 有关此成员的说明，请参见 ToInt16(IFormatProvider)。For a description of this member, see ToInt16(IFormatProvider). 有关此成员的说明，请参见 ToInt32(IFormatProvider)。For a description of this member, see ToInt32(IFormatProvider). 有关此成员的说明，请参见 ToInt64(IFormatProvider)。For a description of this member, see ToInt64(IFormatProvider). 有关此成员的说明，请参见 ToSByte(IFormatProvider)。For a description of this member, see ToSByte(IFormatProvider). 有关此成员的说明，请参见 ToSingle(IFormatProvider)。For a description of this member, see ToSingle(IFormatProvider). 有关此成员的说明，请参见 ToType(Type, IFormatProvider)。For a description of this member, see ToType(Type, IFormatProvider). 有关此成员的说明，请参见 ToUInt16(IFormatProvider)。For a description of this member, see ToUInt16(IFormatProvider). 有关此成员的说明，请参见 ToUInt32(IFormatProvider)。For a description of this member, see ToUInt32(IFormatProvider). 有关此成员的说明，请参见 ToUInt64(IFormatProvider)。For a description of this member, see ToUInt64(IFormatProvider).