title: An object reference is required C# CS0120
body: <p>This question has been asked to death but i cannot take from those answers what my problem is. </p>
  
  <p>All i want to do is : </p>
  
  <ol>
  <li>Declare my global bool variable (used as a flag for later.)</li>
  <li>Run my method to do a check, in which it will change the global variable</li>
  </ol>
  
  <p>Anybody able to explain why this isn't working? Thanks.</p>
  
  <pre><code>    class Program
      {
          public bool onVPN;
  
           static void Main(string[] args)
          {
              CheckVPN();
              CheckIfInternal();
              Console.WriteLine("Press enter to close...");
              Console.ReadLine();
          }
          public void CheckVPN()
          {
              NetworkInterface[] adapters = NetworkInterface.GetAllNetworkInterfaces();
              foreach (NetworkInterface adapter in adapters)
              {
                  //crude way to check if the VPN adapter is running
                  if (adapter.Description == "VPN Adapter")
                  {
                     onVPN = true;
                  }
  
                  else
                  {
                      onVPN = false;
                  }
  
              }
          }
  </code></pre>