string user = System.Environment.UserName
private static class Users { public static string Current() { string[] PathParts = Application.StartupPath.Split('/'); if(PathParts.Length <= 2 || !Environment.OS.IsUnix()) { return null; } return PathParts[2]; } } <pre lang="c#">
System.Security.Principal.WindowsIdentity.GetCurrent().Name
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)