# Login

{% hint style="info" %}
Make sure your program has been initialized and is connected to Auth.GG servers.
{% endhint %}

{% code title="C# WINFORMS" %}

```csharp
private void Button1_Click() { // Login button click event handler

 if(API.Login(username.Text,password.Text))
            {
                //Put code here of what you want to do after successful login
                MessageBox.Show("Login successful!", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
                Main main = new Main();
                main.Show();
                this.Hide();
            }

}
```

{% endcode %}

{% code title="C# CONSOLE" %}

```csharp
static void Main() {

Console.Title = "Auth.GG";
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 (API.Login(username, password))
                    {
                    //Code you want to do here on successful login
MessageBox.Show("You have successfully logged in!", OnProgramStart.Name, MessageBoxButton.OK, MessageBoxImage.Information);
                    }
}
```

{% endcode %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://setup.auth.gg/setting-up/login.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
