Ok here a problem i found this is making accounts with Ini file. What happens is it deletes the account and remakes it lol. Any Ideal on how i can fix this here is my code.
public static byte Authenticate(string Username, string Password)
{
if (Username.StartsWith("NEW"))
{
string CreateName = Username.Remove(0, 3);
string File = System.Windows.Forms.Application.StartupPath + "\\Accounts\\" + CreateName + ".acc";
IniFile Ini = new IniFile(File);
Ini.IniWriteValue("Account", "AccountID", CreateName);
Ini.IniWriteValue("Account", "Password", Password);
Ini.IniWriteValue("Account", "LogonType", "2");
Ini.IniWriteValue("Account", "LogonCount", "0");
Ini.IniWriteValue("Account", "Status", "0");
Ini.IniWriteValue("Account", "Charr", "");
Ini.IniWriteValue("Account", "Online", "0");
}
if (System.IO.File.Exists(System.Windows.Forms.Applic ation.StartupPath + @"\accounts\\" + Username + ".acc"))
{
Ini SR = new Ini(System.Windows.Forms.Application.StartupPath + @"\accounts\\" + Username + ".acc");
string Acc = SR.ReadValue("Account", "AccountID");
string Pass = SR.ReadValue("Account", "Password");
uint LogonType = uint.Parse(SR.ReadValue("Account", "LogonType"));
int LogonCount = Convert.ToInt16(SR.ReadValue("Account", "LogonCount"));
if (Pass == Password || Pass == "")
{
if (Pass == "")
{
SR.WriteString("Account", "Password", Password);
}
LogonCount++;
SR.WriteString("Account", "LogonCount", Convert.ToString(LogonCount));
return Convert.ToByte((uint)LogonType);
}
else
{
return 0;
}
}
else return 0;
}
}
}






