String handle in C#
<p>I don't understand the use of "get" and "set" command, how to add a list of the accounts using the code below and someone give me some example to fix the error? Thanks! :(</p>

<pre><code>    public class Account
    {

        public string UserName

        {get rerurn textBox1.Test; // error
        set UserName = textBox1.Text;} // error

        public string Password { get; set; }
        public string RePassword { get; set; }
        public string Name { get; set; }
        public string bd { get; set; }
        public string dt { get; set; }
        public string dc { get; set; }
    }
    public class ListAcc
    {
        static void Data()
        {
            List&lt;Account&gt; UserList = new List&lt;Account&gt;();
        }
    }
</code></pre>

<p>Okey, thanks everybody, i had fixed that error but if code:</p>

<pre><code> public class ListAcc
        {
            static void Data()
            {
                List&lt;Account&gt; UserList = new List&lt;Account&gt;();
                //example of adding user account
                Account acc = new Account();
                acc.Username = textBox1.Text;
                UserList.Add(acc);
            }
        }
</code></pre>

<p>there are a error from access to textBox1.Text? ( An object reference is required for the nonstatic field, method, or property)... Someone can help?</p>
