bool hasLogin = true; bool hasPermission = false; if (hasLogin && !hasPermission) { Console.WriteLine("已登录但无权限"); }