C# has no concept of global variables: everything is class scope.
However (just like VB) you can declare a
static
class and access everything in it as if they were global:
public static class Globals
{
public static int MyGlobalValue = 42;
}
...
private void MyMethodSomewhereInAClass()
{
Console.WriteLine(Globals.MyGlobalValue);
MyGlobalValue += 23;
}
Technically, the class does not need to be static, but since you should not need to instatiate it, it is a good idea.