我用C#做了一个输密码的控制台程序,我希望在后面加上更改密码的代码,保存到文本里面,下次打开后调用 50
我用C#做了一个输密码的控制台程序,我希望在后面加上更改密码的代码,保存到文本里面,下次打开后调用文本里面保存的密码usingSystem;usingSystem.Col...
我用C#做了一个输密码的控制台程序,我希望在后面加上更改密码的代码,保存到文本里面,下次打开后调用文本里面保存的密码
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication4
{
class Program
{
static void Main(string[] args)
{
bool fanhui = true;
while (fanhui)
{
bool q = true;
while (true)
{
bool[] num = new bool[5];
ConsoleKey[] mima = new ConsoleKey[5];
mima[0] = ConsoleKey.NumPad2;
mima[1] = ConsoleKey.NumPad1;
mima[2] = ConsoleKey.NumPad3;
mima[3] = ConsoleKey.NumPad7;
mima[4] = ConsoleKey.NumPad0;
Console.WriteLine("请在小键盘输入密码");
for (int i = 0; i < 5; i++)
{
System.ConsoleKeyInfo a = Console.ReadKey(true);
num[i] = a.Key.Equals(mima[i]);
if (num[i])
{ Console.Write("*"); }
else
{
Console.Write("*");
q = false;
}
}
System.ConsoleKeyInfo Ent = Console.ReadKey(true);
bool jun = Ent.Key.Equals(ConsoleKey.Enter);
if (jun)
{ break; }
else
{ Console.WriteLine("您输入的密码过长"); q = true; }
}
if (q)
{ Console.WriteLine("密码正确"); fanhui = false; }
else
{
Console.WriteLine("\n密码错误,按T再次输入,按F退出");
while (true)
{
System.ConsoleKeyInfo b = Console.ReadKey();
bool N = b.Key.Equals(ConsoleKey.F);
if (N)
{ fanhui = false; break; }
else
{ Console.WriteLine("请输入正确的指令"); }
bool T = b.Key.Equals(ConsoleKey.T);
if (T)
{ fanhui = true; break; }
else
{ Console.WriteLine("请输入正确的指令"); }
}
}
}
Console.WriteLine("再按一次键盘退出");
Console.ReadKey();
}
}
}
C#怎么把我需要的数据保存下来下次调用 展开
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication4
{
class Program
{
static void Main(string[] args)
{
bool fanhui = true;
while (fanhui)
{
bool q = true;
while (true)
{
bool[] num = new bool[5];
ConsoleKey[] mima = new ConsoleKey[5];
mima[0] = ConsoleKey.NumPad2;
mima[1] = ConsoleKey.NumPad1;
mima[2] = ConsoleKey.NumPad3;
mima[3] = ConsoleKey.NumPad7;
mima[4] = ConsoleKey.NumPad0;
Console.WriteLine("请在小键盘输入密码");
for (int i = 0; i < 5; i++)
{
System.ConsoleKeyInfo a = Console.ReadKey(true);
num[i] = a.Key.Equals(mima[i]);
if (num[i])
{ Console.Write("*"); }
else
{
Console.Write("*");
q = false;
}
}
System.ConsoleKeyInfo Ent = Console.ReadKey(true);
bool jun = Ent.Key.Equals(ConsoleKey.Enter);
if (jun)
{ break; }
else
{ Console.WriteLine("您输入的密码过长"); q = true; }
}
if (q)
{ Console.WriteLine("密码正确"); fanhui = false; }
else
{
Console.WriteLine("\n密码错误,按T再次输入,按F退出");
while (true)
{
System.ConsoleKeyInfo b = Console.ReadKey();
bool N = b.Key.Equals(ConsoleKey.F);
if (N)
{ fanhui = false; break; }
else
{ Console.WriteLine("请输入正确的指令"); }
bool T = b.Key.Equals(ConsoleKey.T);
if (T)
{ fanhui = true; break; }
else
{ Console.WriteLine("请输入正确的指令"); }
}
}
}
Console.WriteLine("再按一次键盘退出");
Console.ReadKey();
}
}
}
C#怎么把我需要的数据保存下来下次调用 展开
2个回答
2015-07-16
展开全部
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication4
{
class Program
{
static void Main(string[] args)
{
bool fanhui = true;
while (fanhui)
{
bool q = true;
while (true)
{
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication4
{
class Program
{
static void Main(string[] args)
{
bool fanhui = true;
while (fanhui)
{
bool q = true;
while (true)
{
追问
还以为等到答案,尼玛仔细一看就是我的东西啊
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询