How to get logged in user name?
<p>I want to take the current logged in user name (windows user) using c#, i have done the following.</p>

<ol>
<li>Create one web application</li>
<li>Published the web application</li>
<li>Created the site in iis and given the physical path</li>
</ol>

<p>when i try to get the user name , am getting the application pool name as current user name, i have used the below line of code. and i have given the anonymous access for this site.</p>

<pre><code>string username = System.Environment.UserName.ToString();
</code></pre>
