- value
- The 32-bit unsigned integer value to be converted.
true if value is non-zero; false if value is zero.
This member is not CLS-compliant. For a CLS-compliant alternative, use Convert.ToBoolean(object)(long).
The following example demonstrates converting uint values to bool values.
C# Example
using System; class ConvertBoolTest { static public void Main() { uint uint0 = 0; uint uint1 = 1; bool bool0 = Convert.ToBoolean(uint0); bool bool1 = Convert.ToBoolean(uint1); Console.WriteLine("(uint) {0} as bool = {1}",uint0,bool0); Console.WriteLine("(uint) {0} as bool = {1}",uint1,bool1); } }The output is
(uint) 0 as bool = False
(uint) 1 as bool = True
Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0