Example #1
0
        private string generateDBPwd()
        {
            string tempPwd = AMUser.CreatePassword(30);             // Create a strong password of length 30
            string pwd     = "";

            for (int i = 0; i < tempPwd.Length; i++)
            {
                // we need to skip characters that cause SQL problems when used in a pwd
                char charCode = tempPwd[i];
                // blocks: ';,`="
                if ((charCode == 39) || (charCode == 59) || (charCode == 44) || (charCode == 96) || (charCode == 61) || (charCode == 34))
                {
                    continue;
                }
                else
                {
                    pwd += tempPwd[i];
                }
            }
            return(pwd);
        }