C cc Sep 4, 2008 #1 Under what circumstances for a windows form app will Environment.Username return empty?
M Morten Wennevik [C# MVP] Sep 5, 2008 #2 cc said: Under what circumstances for a windows form app will Environment.Username return empty? Click to expand... 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.
cc said: Under what circumstances for a windows form app will Environment.Username return empty? Click to expand... 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.