Beispiel #1
0
        public static bool NameIsValid(string Name)
        {
            string _file = Path.Combine(AppUtility.AppDataPath, "StaticContents/NameRestriction.txt");
            string names = File.ReadAllText(_file).ToLower()
                           .Replace(Environment.NewLine, "")
                           .Replace(", ", ",").Replace(",  ", ",").Replace(",   ", ",")
                           .Replace(" ,", ",").Replace("  ,", ",").Replace("   ,", ",");

            string[] restricted = AppUtility.StripHtml(names).Split(',');
            if (restricted.Contains(Name.Trim().ToLower()))
            {
                return(false);
            }

            return(true);
        }