title: Calling a Static method in C#
body: <p>How do I call a static method? I want to call this from a class I have created, I want to get the location from IP. I've declared it but what I need to do is call the method... as <code>static</code>...</p>
  
  <p>To be honest with you, I'm quite confused here, do I need to instantiate <code>address</code>, <code>city</code>, etc.?</p>
  
  <p>I have done this so far;</p>
  
  <p><strong>LocationTools.cs</strong></p>
  
  <pre><code>public static class LocationTools
      {
          public static void GetLocationFromIP(string address, out string city, out string region, out string country, out double? latitude, out double? longitude)
          {
  </code></pre>
  
  <p><strong>Home.cs</strong></p>
  
  <pre><code>   public string IPAPIKey
      {
         get
          {
              return WebConfigurationManager.AppSettings["IPAPIKey"];
          }
      }
  
      ////To get the ip address of the machine and not the proxy use the following code
      static void GetLocationFromIP()
      {
          string strIPAddress = Request.UserHostAddress.ToString();
          strIPAddress = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
  
          if (strIPAddress == null || strIPAddress == "")
          {
              strIPAddress = Request.ServerVariables["REMOTE_ADDR"].ToString();
          }
      }
  }
  </code></pre>
  
  <p>}</p>