Environment.Username empty - win form app

  • Thread starter Thread starter cc
  • Start date Start date
cc said:
Under what circumstances for a windows form app will
Environment.Username return empty?

I don't know. Maybe lacking EnvironmentPermission? Started from a Service
running under Local System or similar account running without logging on?

You could try System.Security.Principal.WindowsIdentity.GetCurrent().Name
instead.
 
Back
Top