Can browse the URL in IE but unable to ping
<pre><code>public static string GetAccessErrorString(string uri)
    {
        HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri);

        try
        {
            HttpWebResponse response = (HttpWebResponse)request.GetResponse();
        }
        catch (Exception e)
        {
            return e.Message;
        }

        return null;
    }
</code></pre>

<p>I am just trying to check the accesibility of a website in above code. I get below error when GetResponse method is invoked.</p>

<blockquote>
  <p>at System.Net.HttpWebRequest.GetResponse()
    at WebStuff.WebsiteReachable.GetAccessErrorString(String uri, WebProxy proxy) 
  in WebsiteReachable.cs:line 22</p>
  
  <p><em>Error : The remote name could not be resolved: 'www.microsoft.com'</em></p>
</blockquote>

<p>I added this in host file and tried but it did not work too.</p>

<p>Actually I am able to browse the site in IE. When I give ping www.microsoft.com I get below message</p>

<blockquote>
  <p>*Ping request could not find host microsoft.com. Please check the name and try 
  again. *</p>
</blockquote>

<p>Could you please help me figuring out the issue?.. If you could point out different possibilities that will be great.</p>
