title: How can I get client machine user login in ASP.net?
body: <p>On <strong>Localhost</strong> my username is 'MTA' when calling this code:</p>
  
  <pre><code>string opl = HttpContext.Current.User.Identity.Name.ToString();
  TextBox1.Text = opl.Substring(opl.IndexOf(@"\") + 1);
  </code></pre>
  
  <p>OR this code:</p>
  
  <pre><code>string opl = System.Environment.UserName.ToString();
  TextBox1.Text = opl.Substring(opl.IndexOf(@"\") + 1);
  </code></pre>
  
  <p>But after publishing and accessing the website from a Windows Server. My username is now 'SRVCMAN'.</p>