Exemplo n.º 1
0
        public static string GetWebCurrentUser(WebUserInformation webUserInformation)
        {
            string result = "";

            try
            {
                string[] userInformation = System.Web.HttpContext.Current.Request.LogonUserIdentity.Name.ToString().Split(@"\".ToCharArray());
                result = userInformation[(int)webUserInformation].ToString();
            }
            catch
            {
                result = "N/A";
            }
            return(result);
        }
Exemplo n.º 2
0
        public static string GetWebCurrentUser(WebUserInformation webUserInformation)
        {
            string result = "";

            try
            {
                //string[] userInformation = HttpContext.Current.User.Identity.Name.ToString().Split(@"\".ToCharArray());
                string[] userInformation = System.Web.HttpContext.Current.Request.LogonUserIdentity.Name.ToString().Split(@"\".ToCharArray());
                result = userInformation[(int)webUserInformation].ToString();
            }
            catch
            {
                result = "N/A";
            }
            //CommonFunctions.Iif(webUserInformation != WebUserInformation.DomainName, userInformation[0], userInformation[1]);

            // Return the result
            return(result.ToUpper());
            //return userSTR;
        }