Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

BitConverter.ToInt32 Method

Returns a 32-bit signed integer converted from four bytes at a specified position in a byte array.

[Visual Basic]
Public Shared Function ToInt32( _
   ByVal value() As Byte, _
   ByVal startIndex As Integer _
) As Integer
[C#]
public static int ToInt32(
 byte[] value,
 int startIndex
);
[C++]
public: static int ToInt32(
 unsigned char value __gc[],
 int startIndex
);
[JScript]
public static function ToInt32(
   value : Byte[],
 startIndex : int
) : int;

Parameters

value
An array of bytes.
startIndex
The starting position within value.

Return Value

A 32-bit signed integer formed by four bytes beginning at startIndex.

Exceptions

Exception Type Condition
ArgumentNullException value is a null reference (Nothing in Visual Basic).
ArgumentOutOfRangeException startIndex is less than zero or greater than the length of value minus 4.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework

See Also

BitConverter Class | BitConverter Members | System Namespace | Int32

Show:
© 2017 Microsoft