public string GetCurrentUser() { string user = Thread.CurrentPrincipal.Identity.Name; if (user.Contains("\\")) { user = user.Substring(user.LastIndexOf("\\") + 1); } return user; }