Convert.ToInt16 Method (Byte)
.NET Framework (current version)
Converts the value of the specified 8-bit unsigned integer to the equivalent 16-bit signed integer.
Assembly: mscorlib (in mscorlib.dll)
Parameters
- value
-
Type:
System.Byte
The 8-bit unsigned integer to convert.
The following example converts each element in an array of Byte values to a 16-bit signed integer.
Dim bytes() As Byte = { Byte.MinValue, 14, 122, Byte.MaxValue} Dim result As Short For Each byteValue As Byte In bytes result = Convert.ToInt16(byteValue) Console.WriteLine("The Byte value {0} converts to {1}.", _ byteValue, result) Next ' The example displays the following output: ' The Byte value 0 converts to 0. ' The Byte value 14 converts to 14. ' The Byte value 122 converts to 122. ' The Byte value 255 converts to 255.
Universal Windows Platform
Available since 8
.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Available since 8
.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Show: