直接这样不就行了?if(resualt=false)
{
   return resualt;
}
else
{
    后续代码;
}

解决方案 »

  1.   

    public bool getinfo(string info)
     {  bool result=false;
        string a="aaaa";
        int s=a.CompareTo("身份证");
    if(s==0)
    {
       resualt=true;
     }
     else
     {
       resualt=false;
               }

             ....         ....  if(resualt=false) 
          {
             return false;
           }
      else
          {
             return true;
          }
     }你的函数是bool型! 只能返回ture or false! 那么把返回ture的做一个判断不就行了吗?用||个&&判断!
    比如 if (result==ture||aaaa=="sdfsdf"||......) 这样就比较明了了!