Add strings to string array
<pre><code>class Myclass
{
    static string[] user_Name = { "admin", "user1", "user2" };
    static string[] user_Password ={ "admin", "123", "789" };

    public static void Check_Method(string u_name, string u_password)
    {

        for (int i = 0; i &lt; user_Name.Length; i++)
        {
            if (u_name == user_Name[i] &amp;&amp; u_password == user_Password[i])
            {
                MessageBox.Show("login successful");
                break;
            }
            else
            {
                if (i == (user_Name.Length - 1))
                    MessageBox.Show("Badshow");
            }
        }
    }
    public static void add_user(string name, string password)
    {
        i=user_Name.Length;
        user_Name[i]=name;
        user_Password[i]=password;
        //here i want to add another user but im unable to find the way
    }
}
</code></pre>

<p>But it gives an error that it is outside the boundary of an array.</p>

<p>What could be the most convenient way to perform this action?</p>
