bool.parse 只能对文本对象进行转换,而且只能是 true or false, 不区分大小写
Convert.ToBoolean 方法可以对文本、数值对象进行转换 0->false, 非0->true
static void Main(string[] args)
{
string a = "true";
bool b1 = bool.Parse(a);// To true
bool b2 = Convert.ToBoolean(a);// To true
int b = 1;
bool b3 = bool.Parse(b.ToString());// 会发生异常
bool b4 = Convert.ToBoolean(b);// To true
}