using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
/**
* 让用户输入用户名和密码,如果用户名为admin,密码为mypass,则提示登录成功.
* */
Console.WriteLine("请输入你的用户名:");
string userName = Console.ReadLine();
Console.WriteLine("请输入你的密码:");
string password = Console.ReadLine();
if ((userName == "admin") && (password == "mypass"))
{
Console.WriteLine("登录成功!");
}
else
{
Console.WriteLine("用户名和密码都错误");
}
Console.ReadKey();
}
}
}
网友评论