public string Execute(params string[] parameters)
        {
            MembershipUserCollection results = null;

            if (!string.IsNullOrEmpty(ByEmail))
            {
                results = Membership.FindUsersByEmail(ByEmail);
            }
            else if (!string.IsNullOrEmpty(ByName))
            {
                results = Membership.FindUsersByName(ByName);
            }
            else
            {
                results = Membership.GetAllUsers();
            }
            int usercnt = 0;

            foreach (MembershipUser user in results)
            {
                usercnt++;
                if (OnlyOnline && !user.IsOnline)
                {
                    continue;
                }

                OnCommandOutput?.Invoke(this, user);
            }
            int onlinecnt = Membership.GetNumberOfUsersOnline();

            return($"Went through {usercnt} users. {onlinecnt} users online.");
        }
 public ActionResult RequestforBusinessAccount(BusinessProfileViewModel businessProfileVM)
 {
     if (ModelState.IsValid)
     {
         if (Membership.FindUsersByName(businessProfileVM.BusinessName).Count == 1)
         {
             ModelState.AddModelError("", "Business name already exists");
             ViewBag.businessCategoryList = commonController.GetAllBusinessCategory();
             return(View(businessProfileVM));
         }
         else if (Membership.FindUsersByEmail(businessProfileVM.Email).Count == 1)
         {
             ModelState.AddModelError("", "Email already exists");
             ViewBag.businessCategoryList = commonController.GetAllBusinessCategory();
             return(View(businessProfileVM));
         }
         else
         {
             businessProfileService.CreateBusinessprofile(businessProfileVM);
             return(RedirectToAction("BusinessView", "Account"));
         }
     }
     else
     {
         ViewBag.businessCategoryList = commonController.GetAllBusinessCategory();
         return(View());
     }
 }
Пример #3
0
        public ActionResult ForgotPassword(ForgotViewModel model)
        {
            if (model.Email != null)
            {
                var  user       = Membership.FindUsersByEmail(model.Email).Cast <MembershipUser>().FirstOrDefault();
                bool isUserFind = false;
                if (user != null)
                {
                    var CoreManager = new CoreManager();
                    model.Password = user.GetPassword();
                    model.UserName = user.UserName;
                    string body = RenderRazorViewToString("Mail", model);

                    try
                    {
                        CoreManager.SendEmail(user.Email, "Восстановление пароля", body);
                        ViewBag.res = "Пароль выслан на вашу почту";
                    }
                    catch (Exception e)
                    {
                        ModelState.AddModelError("", "Произошла ошибка при отправке на почту");
                    }
                }
                else
                {
                    ModelState.AddModelError("", "Пользователя с таким E-mail не найдено");
                }
            }
            return(View());
        }
Пример #4
0
    public static string[] GetCompletionList(string prefixText, int count, string contextKey)
    {
        MembershipUserCollection coll = null;

        if (contextKey.Equals("E-mail"))
        {
            coll = Membership.FindUsersByEmail("%" + prefixText + "%");
        }
        else
        {
            coll = Membership.FindUsersByName(prefixText + "%");
        }

        String[] names = new String[coll.Count];
        int      i     = 0;

        foreach (MembershipUser u in coll)
        {
            if (contextKey.Equals("E-mail"))
            {
                names[i++] = u.Email;
            }
            else
            {
                names[i++] = u.UserName;
            }
        }

        return(names);
    }
Пример #5
0
        public async Task <ActionResult> ResetPassword(string id)
        {
            var context = new SphDataContext();
            var setting = await context.LoadOneAsync <Setting>(x => x.Id == id);

            var model = new ResetPaswordModel {
                IsValid = true, Id = id
            };

            if (null == setting)
            {
                model.IsValid = false;
                model.Mesage  = "The link is invalid";
                return(View(model));
            }

            model.Email = setting.UserName;
            if ((DateTime.Now - setting.CreatedDate).TotalMinutes > 10)
            {
                model.IsValid = false;
                model.Mesage  = "The link has expired";
                return(View(model));
            }
            var user = Membership.FindUsersByEmail(setting.UserName);

            if (user.Count == 0)
            {
                model.IsValid = false;
                model.Mesage  = "Cannot find any user with email  " + model.Email;
            }
            model.Email = setting.UserName;
            return(View(model));
        }
    private void SubmitRequest_Email()
    {
        try
        {
            string msg      = string.Empty;
            string email    = txtResetEmail.Text.Trim();
            string username = string.Empty;
            MembershipUserCollection muc = Membership.FindUsersByEmail(email);
            MembershipUser           mu  = null;
            foreach (MembershipUser tempMU in muc)
            {
                mu    = tempMU;
                email = tempMU.Email;
            }
            if (mu == null)
            {
                FailureText.Text = "An invalid email was specified.";
                return;
            }

            bool submitted = false, emailed = false;
            SubmitRequest(mu, out submitted, out emailed);
        }
        catch (Exception ex)
        {
            LogUtility.LogException(ex);
        }
        finally
        {
            this.divFormDisabler.Style["display"] = "none";
        }
    }
Пример #7
0
        public ActionResult SimpleRestore(RestoreModel model)
        {
            if (model.Email.IsNullOrEmpty() || !model.Email.IsMailAdress())
            {
                model.ErrorText = "Для восстановления пароля необходимо указать Email, использованный при регистрации";
            }
            else
            {
                var user = Membership.FindUsersByEmail(model.Email);
                if (user.Count == 0)
                {
                    model.ErrorText = "Пользователь с таким Email не регистрировался на сайте";
                }
                else
                {
                    foreach (MembershipUser u in user)
                    {
                        var res = MailingList.Get("RestorePassLetter")
                                  .To(model.Email)
                                  .WithReplacement(new MailReplacement("{PASSWORD}", u.GetPassword())).Send();

                        model.ErrorText = res.IsFilled()
                                              ? res
                                              : "Пароль для доступа к сайту был успешно отправлен на указанный Email";
                    }
                }
            }

            return(PartialView(model));
        }
Пример #8
0
        public ActionResult Register(RegisterViewModel model)
        {
            if (!ModelState.IsValid)
            {
                return(View(model));
            }
            else if (Membership.GetUser(model.UserName) != null)
            {
                ModelState.AddModelError("UserName", "A user with that name already exists");
                return(View(model));
            }
            else if (Membership.FindUsersByEmail(model.Email).Count > 0)
            {
                var user = Membership.FindUsersByEmail(model.Email);
                ModelState.AddModelError("Email", "A user with that e-mail already exists");
                return(View(model));
            }

            Membership.CreateUser(model.UserName, model.Password, model.Email);
            Roles.AddUserToRole(model.UserName, "Users");

            FormsAuthentication.SetAuthCookie(model.UserName, true);

            repository.AddStatistic(new CreateStatisticModel
            {
                Type      = (int)StatisticsHelper.StatisticTypes.Register,
                Time      = DateTime.Now,
                IPAddress = Request.UserHostAddress,
                UserName  = model.UserName,
                Email     = model.Email
            });

            return(RedirectToAction("Index", "Profile"));
        }
Пример #9
0
    public bool IsValidMembershipEmailForUpdate(string username, string email)
    {
        try
        {
            MembershipUserCollection mm = Membership.FindUsersByEmail(email);

            if (mm.Count > 0)
            {
                foreach (MembershipUser m in mm)
                {
                    if ((m.UserName != username))
                    {
                        _ErrorMessage = "The E-mail supplied is already in use.<br/>";
                        return(false);
                    }
                }
            }

            return(true);
        }
        catch (Exception ex)
        {
            if (ex.Message.Length <= 60)
            {
                _ErrorMessage = ex.Message;
            }

            _ErrorMessage = "The E-mail supplied is invalid or already exist.";
            return(false);
        }
    }
        public void ProcessRequest(HttpContext context)
        {
            MembershipUser user;
            var            accessToken = context.Request["accessToken"];
            var            client      = new FacebookClient(accessToken);
            dynamic        result      = client.Get("me", new { fields = "first_name,last_name,email" });
            string         last_name   = result.last_name;
            string         first_name  = result.first_name;
            string         email       = result.email;

            if (Membership.FindUsersByEmail(email).Count == 0)
            {
                user = Membership.CreateUser(email, Membership.GeneratePassword(20, 0), email);
                UserProfile userProfile = UserProfile.GetUserProfile(user.UserName);
                userProfile.LastName  = last_name;
                userProfile.FirstName = first_name;
                userProfile.Save();
            }
            else
            {
                user = Membership.GetUser(email);
            }

            //Membership.ValidateUser(user.UserName, user.GetPassword());
            FormsAuthentication.SetAuthCookie(email, true);
            context.Response.Redirect("/Default.aspx");
        }
Пример #11
0
    protected void SearchForUsers(object sender, EventArgs e, GridView dataGrid, DropDownList dropDown, TextBox textBox)
    {
        ICollection coll = null;
        string      text = textBox.Text;

        text = text.Replace("*", "%");
        text = text.Replace("?", "_");
        int total = 0;

        if (text.Trim().Length != 0)
        {
            if (dropDown.SelectedIndex == 0 /* userID */)
            {
                coll = Membership.FindUsersByName(text);
            }
            else
            {
                coll = Membership.FindUsersByEmail(text);
            }
        }

        dataGrid.PageIndex  = 0;
        dataGrid.DataSource = coll;
        dataGrid.DataBind();

        Pager1.TotalRecords = coll.Count;
    }
Пример #12
0
        protected void RadButtonCreate_Click(object sender, EventArgs e)
        {
            if (Membership.FindUsersByName(TextBoxUserName.Text).Count == 0 && Membership.FindUsersByEmail(TextBoxUserName.Text).Count == 0)
            {
                MembershipUser membershipUser = Membership.CreateUser(TextBoxUserName.Text, TextBoxPassword.Text, TextBoxUserName.Text);

                Roles.AddUserToRole(TextBoxUserName.Text, "User");
                //        Roles.AddUserToRole(TextBoxUserName.Text, "Administrator");

                PlaceHolderCreateAdmin.Visible = false;
                CreateAdminStatus.Text         = "User account " + TextBoxUserName.Text + " is created";

                DALPortalDataContext dc      = new DataAccess.Database.DALPortalDataContext();
                userSetting          setting = new userSetting();
                setting.userId             = (Guid)membershipUser.ProviderUserKey;
                setting.name               = TextBoxName.Text;
                setting.companyCode        = companyDDL.SelectedValue;
                setting.defaultCultureCode = "nl";

                dc.userSettings.InsertOnSubmit(setting);
                dc.SubmitChanges();
                Session["username"] = TextBoxUserName.Text;
                Session["name"]     = TextBoxName.Text;
                Response.Redirect("~/Pages/AddRole.aspx");
            }
            else
            {
                CreateAdminStatus.Text = "There is already a user with that username";
            }
        }
Пример #13
0
        public ActionResult ResetPassword(string id)
        {
            var            datos = Membership.FindUsersByEmail(id);
            MembershipUser m     = datos[Membership.GetUserNameByEmail(id)];

            return(View());
        }
Пример #14
0
    protected void BindAllUsers(bool reloadUsers)
    {
        MembershipUserCollection users = null;
        string searchText    = string.Empty;
        bool   searchByEmail = false;

        if (reloadUsers)
        {
            users = Membership.GetAllUsers();
        }
        if (!string.IsNullOrEmpty(gvUsers.Attributes["SearchText"]))
        {
            searchText = gvUsers.Attributes["SearchText"];
        }
        if (!string.IsNullOrEmpty(gvUsers.Attributes["SeachByEmail"]))
        {
            searchByEmail = bool.Parse(gvUsers.Attributes["SeachByEmail"]);
        }
        if (searchText.Length > 0)
        {
            users = searchByEmail ? Membership.FindUsersByEmail(searchText) : Membership.FindUsersByName(searchText);
        }
        else
        {
            users = allUsers;
        }
        gvUsers.DataSource = users;
        gvUsers.DataBind();
    }
Пример #15
0
 /// <summary>
 /// Handles the Click event of the btnSearch control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="T:System.EventArgs"/> instance containing the event data.</param>
 protected void btnSearch_Click(object sender, EventArgs e)
 {
     try {
         if (!string.IsNullOrEmpty(txtSearchBy.Text.Trim()))
         {
             string text = txtSearchBy.Text.Trim();
             text = text.Replace("*", "%");
             text = text.Replace("?", "_");
             if (ddlSearchBy.SelectedIndex == 0 /* userID */)
             {
                 membershipUserCollection = Membership.FindUsersByName(text);
             }
             else
             {
                 membershipUserCollection = Membership.FindUsersByEmail(text);
             }
             BindMembershipUserCollection(membershipUserCollection);
             hlShowAll.Visible = true;
         }
     }
     catch (Exception ex) {
         Logger.Error(typeof(userlist).Name + ".btnSearch_Click", ex);
         Master.MessageCenter.DisplayCriticalMessage(ex.Message);
     }
 }
Пример #16
0
        public void RegistrarUsuario(string NombreUsuario, string Password, string CorreoElectronico)
        {
            MembershipCreateStatus result;
            string Excepcion;

            try
            {
                // Create new user.
                MembershipUserCollection Usuarios = Membership.FindUsersByEmail(CorreoElectronico);
                if (Usuarios.Count <= 0)
                {
                    if (Membership.RequiresQuestionAndAnswer)
                    {
                        MembershipUser newUser = Membership.CreateUser(
                            NombreUsuario, Password, CorreoElectronico, "Pregunta", "Respuesta", false, out result);
                    }
                    else
                    {
                        MembershipUser newUser = Membership.CreateUser(NombreUsuario, Password, CorreoElectronico);
                    }
                }


                //Usada en código de Digitalización.
                //Response.Redirect("login.aspx");
            }
            catch (MembershipCreateUserException e)
            {
                Excepcion = GetErrorMessage(e.StatusCode);
            }
            catch (HttpException e)
            {
                Excepcion = e.Message;
            }
        }
Пример #17
0
        public RedirectToRouteResult Index(Credentials model)
        {
            if (ModelState.IsValid)
            {
                if (Membership.ValidateUser(model.Email, model.Password))
                {
                    string userId = (string)Membership.FindUsersByEmail(model.Email).Cast <MembershipUser>().First().ProviderUserKey;
                    Session["UserId"] = userId;

                    FormsAuthentication.SetAuthCookie(model.Email, false);
                    string [] userRoles = Roles.GetRolesForUser(model.Email);

                    if (userRoles.Contains("admin"))
                    {
                        return(RedirectToAction("CreateFranchize", "Account"));
                    }
                    else if (userRoles.Contains("franchize"))
                    {
                        return(RedirectToAction("Index", "Franchize"));
                    }
                    else if (userRoles.Contains("owner"))
                    {
                        Session["OwnerId"] = DAL.DataManager.GetOwnerId(userId);
                        return(RedirectToAction("List", "App"));
                    }
                }
            }

            return(RedirectToAction("Index", "Login"));
        }
Пример #18
0
        /// <summary>
        /// Saves the current profile.
        /// </summary>
        /// <returns></returns>
        protected virtual bool SaveUser()
        {
            if (!Page.IsValid)
            {
                return(false);
            }

            try
            {
                if (Email.Text != EPiServerProfile.Current.Email &&
                    Membership.FindUsersByEmail(Email.Text).Count > 0)
                {
                    ErrorOccurred(Translate("/templates/personalsettings/validation/emailexists"));
                    return(false);
                }

                SetPostedData();
                EPiServerProfile.Current.Save();
                SaveFailed.Visible     = false;
                SaveSucceeded.Visible  = true;
                CreateEditUser.Visible = false;
            }
            catch (Exception error)
            {
                ErrorOccurred(error.Message);
                return(false);
            }
            return(true);
        }
Пример #19
0
    // Search Parent Button Code
    protected void Button1_Click(object sender, EventArgs e)
    {
        string parentUserName = Membership.GetUserNameByEmail(ParentEmail.Text);

        //MembershipUser parent = Membership.GetUser(parentUserName);
        ParentAssociation.DataSource = Membership.FindUsersByEmail(ParentEmail.Text);
        ParentAssociation.DataBind();
    }
Пример #20
0
        public void FindUsersByEmailTest()
        {
            int totalRecords = 0;
            var results      = Membership.FindUsersByEmail(email, 0, 1, out totalRecords);

            Assert.AreEqual(1, totalRecords);
            Assert.AreEqual(Membership.GetUser(username, false).UserName, results[username].UserName);
        }
Пример #21
0
        public IEnumerable <RegisterModel> GetUserByEmail(string email, int startRowIndex = -1, int maximumRows = -1)
        {
            int recordCount = 0;

            foreach (MembershipUser user in Membership.FindUsersByEmail(email, startRowIndex, maximumRows, out recordCount))
            {
                yield return(this.CreateRegisterModel(user));
            }
        }
Пример #22
0
    private bool UserExists(string usernameEmail)
    {
        if (Membership.FindUsersByEmail(usernameEmail) != null)
        {
            return(true);
        }

        return(false);
    }
Пример #23
0
        public static DataTable CreateUserDataTable(string searchtag, string searchby)
        {
            DataTable  aTable = new DataTable("A");
            DataColumn dtCol;
            DataColumn dtCol1;
            DataRow    dtRow;

            dtCol               = new DataColumn();
            dtCol.DataType      = Type.GetType("System.String");
            dtCol.ColumnName    = "User";
            dtCol.AutoIncrement = false;
            dtCol.ReadOnly      = false;
            dtCol.Unique        = true;
            aTable.Columns.Add(dtCol);

            dtCol1               = new DataColumn();
            dtCol1.DataType      = Type.GetType("System.Boolean");
            dtCol1.ColumnName    = "Active";
            dtCol1.AutoIncrement = false;
            dtCol1.ReadOnly      = false;
            dtCol1.Unique        = false;
            aTable.Columns.Add(dtCol1);

            string text = searchtag;

            text = text.Replace("*", "%");
            text = text.Replace("?", "_");

            if (text.Trim() == "\"\"")
            {
                text = "%";
            }

            if (searchby == "Name")
            {
                foreach (MembershipUser user in Membership.FindUsersByName(text))
                {
                    dtRow           = aTable.NewRow();
                    dtRow["User"]   = user.UserName;
                    dtRow["Active"] = user.IsApproved;
                    aTable.Rows.Add(dtRow);
                }
            }
            else // Mail
            {
                foreach (MembershipUser user in Membership.FindUsersByEmail(text))
                {
                    dtRow           = aTable.NewRow();
                    dtRow["User"]   = user.UserName;
                    dtRow["Active"] = user.IsApproved;
                    aTable.Rows.Add(dtRow);
                }
            }

            aTable.PrimaryKey = new DataColumn[] { aTable.Columns["User"] };
            return(aTable);
        }
Пример #24
0
        //public static string CreateAccount(string userName, string password)
        //{
        //    return CreateAccount(userName, password, requireConfirmationToken: false);
        //}

        //public static string CreateAccount(string userName, string password, bool requireConfirmationToken = false)
        //{
        //    CodeFirstMembershipProvider CodeFirstMembership = Membership.Provider as CodeFirstMembershipProvider;
        //    return CodeFirstMembership.CreateAccount(userName, password, requireConfirmationToken);
        //}

        //public static string CreateUserAndAccount(string userName, string password)
        //{
        //    return CreateUserAndAccount(userName, password, propertyValues: null, requireConfirmationToken: false);
        //}

        //public static string CreateUserAndAccount(string userName, string password, bool requireConfirmation)
        //{
        //    return CreateUserAndAccount(userName, password, propertyValues: null,
        //                                requireConfirmationToken: requireConfirmation);
        //}

        //public static string CreateUserAndAccount(string userName, string password, IDictionary<string, object> values)
        //{
        //    return CreateUserAndAccount(userName, password, propertyValues: values, requireConfirmationToken: false);
        //}

        //public static string CreateUserAndAccount(string userName, string password, object propertyValues = null,
        //                                          bool requireConfirmationToken = false)
        //{
        //    CodeFirstMembershipProvider CodeFirstMembership = Membership.Provider as CodeFirstMembershipProvider;

        //    IDictionary<string, object> values = null;
        //    if (propertyValues != null)
        //    {
        //        values = new RouteValueDictionary(propertyValues);
        //    }

        //    return CodeFirstMembership.CreateUserAndAccount(userName, password, requireConfirmationToken, values);
        //}

        public static List <MembershipUser> FindUsersByEmail(string Email, int PageIndex, int PageSize)
        {
            int totalRecords;

            return
                (Membership.FindUsersByEmail(Email, PageIndex, PageSize, out totalRecords)
                 .Cast <MembershipUser>()
                 .ToList());
        }
        public override FormValidationRule CreateRule(FormField field)
        {
            var value = (string)field.Value;

            return(CreateRule(field, () =>
            {
                return Membership.FindUsersByEmail(value).Cast <MembershipUser>().Any(u => !_onlyApproved || u.IsApproved);
            }));
        }
Пример #26
0
        public void registerUserBT_Click(object sender, EventArgs args)
        {
            errorDivTag.InnerHtml = null;
            if (passTB.Text.Contains(" "))
            {
                errorDivTag.InnerHtml += "<li>Heslo nesmí obsahovat mezery</li>";
            }
            if (passTB.Text != pass2TB.Text)
            {
                errorDivTag.InnerHtml += "<li>Zadaná hesla nejsou stejná</li>";
            }
            if (passTB.Text.Count() > 0 && passTB.Text.Count() < Membership.MinRequiredPasswordLength)
            {
                errorDivTag.InnerHtml += "<li>Minimální délka hesla je " + Membership.MinRequiredPasswordLength + " znaků</li>";
            }
            if (passTB.Text.Count() < 1)
            {
                errorDivTag.InnerHtml += "<li>Nezadali jste heslo. Heslo je povinné</li>";
            }
            if (Membership.FindUsersByEmail(emailTB.Text).Count > 0)
            {
                errorDivTag.InnerHtml += "<li>Pro tento e-mail je již registrován jiný uživatel</li>";
            }

            if (string.IsNullOrEmpty(errorDivTag.InnerHtml))
            {
                try
                {
                    user.registerUserAccount(emailTB.Text, passTB.Text, nameTB.Text, surnameTB.Text, rolesRBL.SelectedValue);
                    string mailBody = "<h1>Vítejte!</h1>";
                    mailBody += "<p>Někdo použil tuto e-mailovou adresu pro registraci uživatelského účtu do <a href='http://sbirkaprikladu.eu'>SbírkyPříkladů</a></p>";
                    mailBody += "<p>Pokud je to vpořádku dokončete žádost o registraci kliknutím na následující odkaz <a href='http://sbirkaprikladu.eu/Admin/Users/confirmUserEmailRegistration.aspx?uId=" + Membership.FindUsersByName(emailTB.Text)[emailTB.Text].ProviderUserKey.ToString() + "'>";
                    mailBody += "http://sbirkaprikladu.eu/Admin/Users/confirmUserEmailRegistration.aspx?uId=" + Membership.FindUsersByName(emailTB.Text)[emailTB.Text].ProviderUserKey.ToString() + "</a></p>";
                    mailBody += "<p>Pokud jste o registraci nežádali, považujte prosím tento e-mail za bezpředmětný.</p>";
                    mailBody += "<p><br /><br />S pozdravem tým SbírkyPříkladů</p>";
                    emailManager.sendEmail(null, emailTB.Text, "Žádost o registraci uživatelského účtu", mailBody);
                }
                catch (MembershipCreateUserException e) { errorDivTag.InnerHtml += "<li>" + GetErrorMessage(e.StatusCode) + "</li>"; }
                catch (HttpException e) { errorDivTag.InnerHtml += "<li>" + e.Message + "</li>"; }
            }

            if (!string.IsNullOrEmpty(errorDivTag.InnerHtml))
            {
                errorDivTag.InnerHtml  = "<strong>Něco je špatně!</strong><ul>" + errorDivTag.InnerHtml;
                errorDivTag.InnerHtml += "</ul>";
                errorDivTag.Visible    = true;
                return;
            }
            else
            {
                errorDivTag.Visible = false;
            }
            contentPN.Visible = false;
            successPN.Visible = true;
        }
Пример #27
0
        public ActionResult RecoverPassword(string id)
        {
            if (String.IsNullOrEmpty(id))
            {
            }
            var datos = Membership.FindUsersByEmail(id);

            ViewBag.Mail     = id;
            ViewBag.Question = datos[Membership.GetUserNameByEmail(id)].PasswordQuestion;
            return(View());
        }
        public void CanFindUsersByEmailWithNoRangesSpecified()
        {
            //arrange
            var created = CreateUsers(2);

            //act
            MembershipUserCollection actual = Membership.FindUsersByEmail(TEST_EMAIL);

            //assert
            Assert.That(actual.Count, Is.AtLeast(2));
        }
Пример #29
0
        public static List <MembershipUser> GetUserListByEmail(string email)
        {
            List <MembershipUser> usrs = new List <MembershipUser>();
            int iCt = 0;

            foreach (MembershipUser usr in Membership.FindUsersByEmail(email, 0, 25, out iCt))
            {
                usrs.Add(usr);
            }
            return(usrs);
        }
 public void FindUsersByEmailTest1()
 {
     try {
         MembershipUserCollection users = Membership.FindUsersByEmail("*****@*****.**");
         Assert.AreEqual(users.Count, 1);
     }
     catch (Exception ex) {
         Console.WriteLine(ex.Message + ex.StackTrace);
         Assert.Fail("Error in FindUsersByEmailTest1", ex);
     }
 }