Share via


File.ReadAllBytes Method

Opens a binary file, reads the contents of the file into a byte array, and then closes the file.

Namespace: System.IO
Assembly: mscorlib (in mscorlib.dll)

Syntax

public static byte ReadAllBytes (
         stringpath
)

Parameters

  • path
    The file to open for reading.

Return Value

A byte array containing the contents of the file.

Version Information

Available in the .NET Micro Framework versions 3.0, 4.0, and 4.1.

See Also

Reference

File Class
File Members
System.IO Namespace