예제 #1
0
 static void GetAllUsers()
 {
     MyCustomMemberships provider = new MyCustomMemberships();
     provider.Initialize(null, null);
     int totalRecords;
     MembershipUserCollection users = provider.GetAllUsers(0, 3, out totalRecords);
     foreach (MembershipUser user in users)
     {
         Console.WriteLine(user.UserName);
     }
     Console.WriteLine("done!");
     Console.ReadLine();
 }
예제 #2
0
        static void CreateUser()
        {
            MyCustomMemberships provider = new MyCustomMemberships();
            provider.Initialize(null, null);
            MembershipCreateStatus mcs;
            MembershipUser mu = provider.CreateUser("david", "ABCdefg1234$", "*****@*****.**", "dogs name", "wags", true, null, out mcs);

            if(mu != null){

                Console.WriteLine(mu.UserName + " has been added to the user store!");
            }else{
                string status = GetErrorMessage(mcs);
                Console.WriteLine(status);
            }
            Console.WriteLine("done!");
            Console.ReadLine();
        }