- value
- The byte value to be converted.
true if value is non-zero; false if value is zero.
Documentation for this section has not yet been entered.
The following example demonstrates converting byte values to bool values.
C# Example
using System; class ConvertBoolTest { static public void Main() { byte byte0 = (byte) 0; byte byte1 = (Byte) 1; bool bool0 = Convert.ToBoolean(byte0); bool bool1 = Convert.ToBoolean(byte1); Console.WriteLine("(byte) {0} as bool = {1}",byte0,bool0); Console.WriteLine("(byte) {0} as bool = {1}",byte1,bool1); } }The output is
(byte) 0 as bool = False
(byte) 1 as bool = True
Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0