title: Getting domain name and user id c#
body: <p>I want to get the domain name and username.</p>
  
  <p>I want it to return domainname\username    forexample:    Cool\Beans</p>
  
  <p>My application is linked to both an internett and a locally runned program.</p>
  
  <p>When i run it locally(as an application) 
  it returns The correct domainname and username. feks: Cool\Beans
  That is when im using: </p>
  
  <pre><code>Environment.UserDomainName +"\\"+Environment.UserName
  </code></pre>
  
  <p>or when im using</p>
  
  <pre><code>WindowsIdentity.GetCurrent().Name 
  </code></pre>
  
  <p>When im trying to use this in the internett application it returns. Workgroup\Cool$</p>
  
  <p>I have tried to use <code>HttpContext.Current.User.Identity.Name</code> it returns null</p>
  
  <p>Anyone have any ideas??</p>
  
  <p>Thanks for answers</p>