ReadAllBytes Method
[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]
Opens a binary file, reads the contents of the file into a byte array, and then closes the file.
Namespace: System.IO
Assembly: System.IO (in System.IO.dll)
Syntax
'Declaration
Public Shared Function ReadAllBytes ( _
path As String _
) As Byte()
public static byte[] ReadAllBytes(
string path
)
public:
static array<unsigned char>^ ReadAllBytes(
String^ path
)
static member ReadAllBytes :
path:string -> byte[]
public static function ReadAllBytes(
path : String
) : byte[]
Parameters
- path
Type: System. . :: . .String
The file to open for reading.
Return Value
Type: array<System. . :: . .Byte> [] () [] []
A byte array containing the contents of the file.
Remarks
Given a file path, this method opens the file, reads the contents of the file into a byte array, and then closes the file.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see dd66cd4c-b087-415f-9c3e-94e3a1835f74.