using System; using System.Collections.Generic; using System.Text; namespace @if ... { class Program ...{ static void Main(string[] args) ...{ int count = 0; start: Console.Write("请输入您的用户名: "); string str = Console.ReadLine(); if (str.Length > 0) ...{ if (str.Equals("user name")) ...{ Console.WriteLine("您输入正确,谢谢您的使用,再见!"); } else if (count < 2) ...{ Console.WriteLine("您输入错误,请重新输入。"); count = count + 1; goto start; } else ...{ Console.WriteLine("您输入错误的次数超过三次,谢谢您的使用。"); } } else ...{ Console.WriteLine("您没有输入用户名,再见!"); } } }}