身份验证

来源:百度文库 编辑:神马文学网 时间:2024/06/03 01:59:42
 using System;
 class validate
 {
  public static void Main()
  {
   string str_wrench="ilovemyfamily";
   string str_next="";
   Console.WriteLine ("请输入你的姓名:");
   Console.ReadLine ();
   do
   {
    Console.WriteLine ("请输入你的密码:");
    string str_passwd=Console.ReadLine ();
    if(str_passwd!=str_wrench)
    {
    Console.WriteLine ("密码不正确,是否继续?Y/N");
    }
    str_next=Console.ReadLine ();
   }while(str_next=="y"||str_next=="Y");
  }
 }