While you should use ||instead |, they will give the same result in this situation. Although responding to other answers, changing |to ||will not solve your problem.
, , , . student, student, 4 .
, 3 , , .
, , , :
if (userName.Length > 4 && userName != "student")
{
Application.Exit();
}