Environment.Username empty - win form app

  • Thread starter Thread starter cc
  • Start date Start date
C

cc

Under what circumstances for a windows form app will
Environment.Username return empty?
 
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top