当我遇到这个小问题时,我正在 COSMOS 中创建一个操作系统。
else if (HOLOOS.seperate(MyGlobals.input, 5) == "login")
{
if (MyGlobals.input == "login")
{
Console.Write(Commands.login.usage);
}
else
{
var arg = HOLOOS.rseperate(MyGlobals.input, 6, (MyGlobals.input.Length - 1));
arg = HOLOOS.GatherArgs(arg);
login.run(arg);
}
}
这是登录类..我猜公共静态无效运行有问题?
class login
{
public static string CurrentUser;
public static void run(string EnteredUser, string EnteredPassword, string User1CorrectName, string User1CorrectCode, string User2CorrectName = "", string User2CorrectCode = "")
{
string EnteredHashedPassword = BashUtils.Encrypt(EnteredPassword);
//Check if the user name is
if (EnteredUser == User1CorrectName)
{
//If the user name entered is jacob, then check if the password is OK
if (EnteredHashedPassword == BashUtils.Encrypt(User1CorrectCode))
{
//If password is okay than login
Console.Write("You have sucessfully logged in as " + User1CorrectName);
CurrentUser = User1CorrectName;
cd.Path = "D:\\" + User1CorrectName + "\\";
}
//If the password is not OK then say so
else
{
Console.Write("Not correct password for " + User2CorrectName);
}
}