System.BitConverter.GetBytes Method

Returns the specified Boolean value as an array of bytes.

Syntax

public static byte[] GetBytes (bool value)

Parameters

value
A Boolean value.

Returns

An array of bytes with length 1.

Remarks

Returns 1 byte (true: 1, false: 0)

Requirements

Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0