Windows Dev Center

Convert.ToByte Method (Boolean)

Converts the value of the specified Boolean value to the equivalent 8-bit unsigned integer.

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

public static byte ToByte(
	bool value


Type: System.Boolean
A Boolean value.

Return Value

Type: System.Byte
The number 1 if value is true; otherwise, 0.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

© 2015 Microsoft