<p>Why use a GlobalClass? What are they for? I have inherited some code (shown below) and as far as I can see there is no reason why strUserName needs this. What is all for?</p>

<pre><code>public static string strUserName
    {
        get { return m_globalVar; }
        set { m_globalVar = value; }
    }
</code></pre>

<p>Used later as:</p>

<pre><code>GlobalClass.strUserName
</code></pre>

<p>Thanks</p>

When you want to use a
static
member of a type, you use it like
```
ClassName.MemberName
```
. If your code snippet is in the same class as the member you're referring (in this example, you're coding in a GlobalClass member, and using strUserName) you
can
omit the class name. Otherwise, it's required as the compiler wouldn't have any knowledge of what class you're referring to.