string s = "true";
bool b = s.ToUpper()=="TRUE";

解决方案 »

  1.   

    我的程序是这样的
    mydata = sampReader.GetString(4); if(mydata="xxxx")
    RadioButtonList4.Items[1].Selected=true;

    Label22.Text = mydata.ToString(); 然后就提示无法将类型“string”隐式转换为“bool”怎么解决???
      

  2.   

    string str = "True";bool b = bool.Parse( str );
      

  3.   

    if(mydata="xxxx")改成
    if(mydata=="xxxx")
      

  4.   

    string s = "true";
    bool b = s.ToUpper()=="TRUE";
    好用
      

  5.   

    string my="False"
    bool me1=bool.Parse(my)