Login

Make sure your software has been initialized. See Initial Setup to initialized.

// C# Form
private void LoginButton1_Click() { 
  if (StackAPI.Login(username.Text, password.Text))
  {
      MessageBox.Show("Login successful!", OnProgramStart.Name, MessageBoxButtons.OK, MessageBoxIcon.Information);
      Main main = new Main();
      main.Show();
      this.Hide();
   }
}
// C# Console
static void Main() {

Console.Title = OnProgramStart.Name;
Console.Write("Enter your username: ");
string username = Console.ReadLine();
Console.Write("Enter your password: ");
string password = Console.ReadLine();
Console.ForegroundColor = ConsoleColor.Green;
Console.WriteLine("Authenticating...");
Console.ForegroundColor = ConsoleColor.White;
if (StackAPI.Login(username, password))
{
    MessageBox.Show("Login successful!", OnProgramStart.Name, MessageBoxButtons.OK, MessageBoxIcon.Information);
    //Your code
}
}

Last updated