当前位置: 首页>>代码示例>>C#>>正文


C# RoleManager.RoleExists方法代码示例

本文整理汇总了C#中RoleManager.RoleExists方法的典型用法代码示例。如果您正苦于以下问题:C# RoleManager.RoleExists方法的具体用法?C# RoleManager.RoleExists怎么用?C# RoleManager.RoleExists使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在RoleManager的用法示例。


在下文中一共展示了RoleManager.RoleExists方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Create

        public async Task<ActionResult> Create(DoctorViewModel DoctorViewModel)
        {
            if (ModelState.IsValid)
            {
                var UserManager = new UserManager<ApplicationUser>(new UserStore<ApplicationUser>(context));
                var RoleManager = new RoleManager<IdentityRole>(new RoleStore<IdentityRole>(context));
                var user = new ApplicationUser() { UserName = DoctorViewModel.Email };
                var result = await UserManager.CreateAsync(user, DoctorViewModel.Password);
                string roleName = "Doctor";
                IdentityResult roleResult;
                if (!RoleManager.RoleExists(roleName))
                {
                    roleResult = RoleManager.Create(new IdentityRole(roleName));
                }
                try
                {
                    var findUser = UserManager.FindByName(DoctorViewModel.Email);
                    UserManager.AddToRole(findUser.Id, "Doctor");
                    context.SaveChanges();
                }
                catch
                {
                    throw;
                }
                Doctor_Detail doctor = MapDoctor(DoctorViewModel);
                db.Doctor_Details.Add(doctor);
                await db.SaveChangesAsync();
                return RedirectToAction("Index");
            }

            return View(DoctorViewModel);
        }
开发者ID:Marsh87,项目名称:MedicalInformationSystem,代码行数:32,代码来源:Doctor_DetailController.cs

示例2: AddUserAndRole

        internal void AddUserAndRole()
        {
            ApplicationDbContext context = new ApplicationDbContext();
            IdentityResult IdRoleResult;
            IdentityResult IdUserResult;

            RoleStore<IdentityRole> roleStore = new RoleStore<IdentityRole>(context);
            RoleManager<IdentityRole> roleMgr = new RoleManager<IdentityRole>(roleStore);

            //create admin role
            if(!roleMgr.RoleExists("admin")) {
                IdRoleResult = roleMgr.Create(new IdentityRole { Name = "admin" });
            }

            //create master user
            UserManager<ApplicationUser> userMgr = new UserManager<ApplicationUser>(new UserStore<ApplicationUser>(context));
            ApplicationUser appUser = new ApplicationUser {
                UserName = "Adam",
                Email = "[email protected]"
            };
            IdUserResult = userMgr.Create(appUser, "Baseball1!");

            //add to admin role
            if(!userMgr.IsInRole(userMgr.FindByEmail("[email protected]").Id, "admin")) {
                IdUserResult = userMgr.AddToRole(userMgr.FindByEmail("[email protected]").Id, "admin");
            }
        }
开发者ID:adam-currie,项目名称:SET-SQ1-EMS,代码行数:27,代码来源:RoleActions.cs

示例3: SeedRolesAndUsers

        private void SeedRolesAndUsers(ETCCanadaContext context)
        {
            RoleManager<ApplicationRole> roleManager = new RoleManager<ApplicationRole>(new RoleStore<ApplicationRole>(context));

            if (!roleManager.RoleExists("Administrator"))
            {
                roleManager.Create(new ApplicationRole("Administrator"));
            }

            if (!roleManager.RoleExists("User"))
            {
                roleManager.Create(new ApplicationRole("User"));
            }

            List<ApplicationUser> users = new List<ApplicationUser>();
            ApplicationUser user1 = new ApplicationUser { UserName = "[email protected]", Email = "[email protected]", FirstName = "Administrator", LastName = "Administrator", IsApproved = true };
            ApplicationUser user2 = new ApplicationUser { UserName = "[email protected]", Email = "[email protected]", FirstName = "User", LastName = "User", IsApproved = true };
            users.Add(user1);
            users.Add(user2);

            SeedDefaultUser(context, user1, "Administrator");
            SeedDefaultUser(context, user2, "User");

            //http://stackoverflow.com/questions/20470623/asp-net-mvc-asp-net-identity-seeding-roles-and-users
            //http://stackoverflow.com/questions/19280527/mvc5-seed-users-and-roles
            //http://stackoverflow.com/questions/19745286/asp-net-identity-db-seed
        }
开发者ID:majurans,项目名称:ETCCanada,代码行数:27,代码来源:DataSeeder.cs

示例4: Users

        public ActionResult Users()
        {
            var roleManager = new RoleManager<IdentityRole>(new RoleStore<IdentityRole>(db));
            if (!roleManager.RoleExists("user"))
            {
                var nRole = new IdentityRole("user");
                roleManager.Create(nRole);
            }
            if (!roleManager.RoleExists("admin"))
            {
                var nRole = new IdentityRole("admin");
                roleManager.Create(nRole);
            }
            if (!roleManager.RoleExists("moderator"))
            {
                var nRole = new IdentityRole("moderator");
                roleManager.Create(nRole);
            }
            if (!roleManager.RoleExists("journalist"))
            {
                var nRole = new IdentityRole("journalist");
                roleManager.Create(nRole);
            }

            var vm = new AdminUsersViewModel();

            vm.Users = db.Users.OrderBy(x => x.UserName).ToList();
            vm.Roles = db.Roles.ToList();

            return View(vm);
        }
开发者ID:mjdean1994,项目名称:Athenaeum,代码行数:31,代码来源:AdminController.cs

示例5: InitializeRoles

    /// <summary>
    /// Checks for the three roles - Admin, Employee and Complainant and 
    /// creates them if not present
    /// </summary>
    public static void InitializeRoles()
    {  // Access the application context and create result variables.
        ApplicationDbContext context = new ApplicationDbContext();
        IdentityResult IdUserResult;

        // Create a RoleStore object by using the ApplicationDbContext object. 
        // The RoleStore is only allowed to contain IdentityRole objects.
        var roleStore = new RoleStore<IdentityRole>(context);

        RoleManager roleMgr = new RoleManager();
        if (!roleMgr.RoleExists("Administrator"))
        {
            roleMgr.Create(new ApplicationRole { Name = "Administrator" });
        }
        if (!roleMgr.RoleExists("Employee"))
        {
            roleMgr.Create(new ApplicationRole { Name = "Employee" });
        }
        if (!roleMgr.RoleExists("Complainant"))
        {
            roleMgr.Create(new ApplicationRole { Name = "Complainant" });
        }
        if (!roleMgr.RoleExists("Auditor"))
        {
            roleMgr.Create(new ApplicationRole { Name = "Auditor" });
        }
      

        // Create a UserManager object based on the UserStore object and the ApplicationDbContext  
        // object. Note that you can create new objects and use them as parameters in
        // a single line of code, rather than using multiple lines of code, as you did
        // for the RoleManager object.
        var userMgr = new UserManager<ApplicationUser>(new UserStore<ApplicationUser>(context));
        var appUser = new ApplicationUser
        {
            UserName = "Administrator",
            Email = "[email protected]"
        };
        IdUserResult = userMgr.Create(appUser, "Admin123");

        // If the new "canEdit" user was successfully created, 
        // add the "canEdit" user to the "canEdit" role. 
        if (!userMgr.IsInRole(userMgr.FindByEmail("[email protected]").Id, "Administrator"))
        {
            IdUserResult = userMgr.AddToRole(userMgr.FindByEmail("[email protected]").Id, "Administrator");
        }
         appUser = new ApplicationUser
        {
            UserName = "Auditor",
            Email = "[email protected]"
        };
        IdUserResult = userMgr.Create(appUser, "Auditor123");

        // If the new "canEdit" user was successfully created, 
        // add the "canEdit" user to the "canEdit" role. 
        if (!userMgr.IsInRole(userMgr.FindByEmail("[email protected]").Id, "Auditor"))
        {
            IdUserResult = userMgr.AddToRole(userMgr.FindByEmail("[email protected]").Id, "Auditor");
        }
    }
开发者ID:chandankpgreen,项目名称:PGRAMS,代码行数:64,代码来源:UserRoleInitialization.cs

示例6: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            HtmlGenericControl body = (HtmlGenericControl)Master.FindControl("BodyTag");
            body.Attributes.Add("class", "login");

            RoleStore<IdentityRole> roleStore = new RoleStore<IdentityRole>();
            RoleManager<IdentityRole> roleMgr = new RoleManager<IdentityRole>(roleStore);

            if (User.Identity.IsAuthenticated)
            {
                Response.Redirect("~/MainPage.aspx");
            }

            //creating roles//
            if (!roleMgr.RoleExists("Admin"))
            {
                IdentityResult roleResult = roleMgr.Create(new IdentityRole("Admin"));
            }
            if (!roleMgr.RoleExists("Manager"))
            {
                IdentityResult roleResult = roleMgr.Create(new IdentityRole("Manager"));
            }
            if (!roleMgr.RoleExists("SalesAssoc"))
            {
                IdentityResult roleResult = roleMgr.Create(new IdentityRole("SalesAssoc"));
            }
            if (!roleMgr.RoleExists("Designer"))
            {
                IdentityResult roleResult = roleMgr.Create(new IdentityRole("Designer"));
            }
            if (!roleMgr.RoleExists("Laborers"))
            {
                IdentityResult roleResult = roleMgr.Create(new IdentityRole("Laborers"));
            }
        }
开发者ID:amoryjh,项目名称:nbd_asp,代码行数:35,代码来源:Default.aspx.cs

示例7: CreateUserAndRole

        internal void CreateUserAndRole()
        {
            using (var context = new WebDeveloperDbContext())
            {

                var roleManager = new RoleManager<IdentityRole>(new RoleStore<IdentityRole>(context));
                var userManager = new UserManager<WebDeveloperUser>(new UserStore<WebDeveloperUser>(context));

                // In Startup iam creating first Admin Role and creating a default Admin User
                if (!roleManager.RoleExists("Admin"))
                {

                    // first we create Admin rool
                    var role = new IdentityRole();
                    role.Name = "Admin";
                    roleManager.Create(role);

                    //Here we create a Admin super user who will maintain the website

                    var user = new WebDeveloperUser
                    {
                        UserName = "[email protected]",
                        Email = "[email protected]"
                    };

                    string userPassword = "Passw0rd2016";

                    var userCreation = userManager.Create(user, userPassword);

                    //Add default User to Role Admin
                    if (userCreation.Succeeded)
                        userManager.AddToRole(user.Id, "Admin");

                }

                // creating Creating Manager role
                if (!roleManager.RoleExists("Manager"))
                {
                    var role = new IdentityRole
                    {
                        Name = "Manager"
                    };
                    roleManager.Create(role);

                }

                // creating Creating Employee role
                if (!roleManager.RoleExists("Employee"))
                {
                    var role = new IdentityRole
                    {
                        Name = "Employee"
                    };
                    roleManager.Create(role);

                }
            }
        }
开发者ID:ChristianUbillus,项目名称:Cibertec_Final_Project,代码行数:58,代码来源:Startup.cs

示例8: SetupRolesAndUsers

        private static void SetupRolesAndUsers(DbContext context)
        {
            var roleManager = new RoleManager<IdentityRole>(new RoleStore<IdentityRole>(context));
            var userManager = new UserManager<ApplicationUser>(new UserStore<ApplicationUser>(context));
            // add roles
            if (!roleManager.RoleExists(Role.Guest.ToString()))
                roleManager.Create(new IdentityRole(Role.Guest.ToString()));
            if (!roleManager.RoleExists(Role.Supplier.ToString()))
                roleManager.Create(new IdentityRole(Role.Supplier.ToString()));
            if (!roleManager.RoleExists(Role.Deactivated.ToString()))
                roleManager.Create(new IdentityRole(Role.Deactivated.ToString()));
            if (!roleManager.RoleExists(Role.User.ToString()))
                roleManager.Create(new IdentityRole(Role.User.ToString()));
            var adminRole = roleManager.FindByName(Role.Admin.ToString());
            if (adminRole == null)
            {
                adminRole = new IdentityRole(Role.Admin.ToString());
                roleManager.Create(adminRole);
            }
            #if DEBUG
            //add admin user
            var admin = userManager.Find(Admin_User, Admin_Pass);
            if (admin == null)
            {
                admin = new ApplicationUser
                {
                    UserName = Admin_User,
                    Email = Admin_Mail,
                    EmailConfirmed = true
                };
                var result = userManager.Create(admin, Admin_Pass);
                // TODO: verify returned IdentityResult
                userManager.AddToRole(admin.Id, Role.Admin.ToString());
                result = userManager.SetLockoutEnabled(admin.Id, false);
            }

            var rolesForUser = userManager.GetRoles(admin.Id);
            if (!rolesForUser.Contains(adminRole.Name))
            {
                var result = userManager.AddToRole(admin.Id, adminRole.Name);
            }

            //add normal user
            if (userManager.Find("[email protected]", "1q2w3e4r") == null)
            {
                var user = new ApplicationUser
                {
                    UserName = "[email protected]",
                    Email = "[email protected]",
                    EmailConfirmed = true
                };
                userManager.Create(user, "1q2w3e4r");
                // TODO: verify returned IdentityResult
                userManager.AddToRole(user.Id, Role.User.ToString());
            }
            #endif
        }
开发者ID:uaandrei,项目名称:d4232ffg,代码行数:57,代码来源:DbConfig.cs

示例9: AddUserAndRole

        internal void AddUserAndRole()
        {
            // Access the application context and create result variables.
            Models.ApplicationDbContext context = new ApplicationDbContext();
            IdentityResult IdRoleResult;
            IdentityResult IdUserResult;

            // Create a RoleStore object by using the ApplicationDbContext object.
            // The RoleStore is only allowed to contain IdentityRole objects.
            var roleStore = new RoleStore<IdentityRole>(context);

            // Create a RoleManager object that is only allowed to contain IdentityRole objects.
            // When creating the RoleManager object, you pass in (as a parameter) a new RoleStore object.
            var roleMgr = new RoleManager<IdentityRole>(roleStore);

            // Then, you create the "canEdit" role if it doesn't already exist.
            if (!roleMgr.RoleExists("Admin"))
            {
                IdRoleResult = roleMgr.Create(new IdentityRole { Name = "Admin" });
            }

            //create the "canBuy" role if it doesn't already exist.
            if (!roleMgr.RoleExists("Normal"))
            {
                IdRoleResult = roleMgr.Create(new IdentityRole { Name = "Normal" });
            }

            // Create a UserManager object based on the UserStore object and the ApplicationDbContext
            // object. Note that you can create new objects and use them as parameters in
            // a single line of code, rather than using multiple lines of code, as you did
            // for the RoleManager object.
            var userMgr = new UserManager<ApplicationUser>(new UserStore<ApplicationUser>(context));
            var appUser = new ApplicationUser
            {
                UserName = "Michael",
                Email = "[email protected]",
                PhoneNumber = "0172215759"
            };
            IdUserResult = userMgr.Create(appUser, "aaa111A!");

            // If the new "canEdit" user was successfully created,
            // add the "canEdit" user to the "canEdit" role.
            AddToAdminUserRole(appUser);
            AddToNormalUserRole(appUser);
            //if (!userMgr.IsInRole(userMgr.FindByEmail("[email protected]").Id, "canEdit"))
            //{
            //    IdUserResult = userMgr.AddToRole(userMgr.FindByEmail("[email protected]").Id, "canEdit");
            //}
            //if (!userMgr.IsInRole(userMgr.FindByEmail("[email protected]").Id, "canBuy"))
            //{
            //    IdUserResult = userMgr.AddToRole(userMgr.FindByEmail("[email protected]").Id, "canBuy");
            //}
        }
开发者ID:MhdNZ,项目名称:MenStore,代码行数:53,代码来源:UserRoleActions.cs

示例10: SeedRoles

        public static void SeedRoles(ApplicationDbContext db)
        {
            var store = new RoleStore<IdentityRole>(db);
            var manager = new RoleManager<IdentityRole>(store);

            if (!manager.RoleExists(Roles.USER))
            {
                manager.Create(new IdentityRole() { Name = Roles.USER });
            }
            if (!manager.RoleExists(Roles.ADMIN))
            {
                manager.Create(new IdentityRole() { Name = Roles.ADMIN });
            }
        }
开发者ID:giorosati,项目名称:ClassicJaguars,代码行数:14,代码来源:Seeder.cs

示例11: Seed

        public static void Seed(ApplicationDbContext context)
        {
            UserStore<ApplicationUser> userStore = new UserStore<ApplicationUser>(context);
            UserManager<ApplicationUser> userManager = new UserManager<ApplicationUser>(userStore);

            RoleStore<Role> roleStore = new RoleStore<Role>(context);
            RoleManager<Role> roleManager = new RoleManager<Role>(roleStore);

            if (!roleManager.RoleExists("Admin"))
                roleManager.Create(new Role { Name = "Admin" });

            if (!roleManager.RoleExists("User"))
                roleManager.Create(new Role { Name = "User" });

            IdentityResult result = null;

            ApplicationUser user1 = userManager.FindByName("[email protected]");

            if (user1 == null)
            {
                user1 = new ApplicationUser { Email = "[email protected]", UserName = "[email protected]" };
            }

            result = userManager.Create(user1, "asdfasdf");
            if (!result.Succeeded)
            {
                string error = result.Errors.FirstOrDefault();
                throw new Exception(error);
            }

            userManager.AddToRole(user1.Id, "Admin");
            user1 = userManager.FindByName("[email protected]");

            ApplicationUser user2 = userManager.FindByName("[email protected]");

            if (user2 == null)
            {
                user2 = new ApplicationUser { Email = "[email protected]", UserName = "[email protected]" };
            }

            result = userManager.Create(user2, "asdfasfd");
            if (!result.Succeeded)
            {
                string error = result.Errors.FirstOrDefault();
                throw new Exception(error);
            }

            userManager.AddToRole(user2.Id, "User");
            user2 = userManager.FindByName("[email protected]");
        }
开发者ID:keigito,项目名称:DryLightningDetector,代码行数:50,代码来源:Seeder.cs

示例12: AddUserAndRole

        internal void AddUserAndRole()
        {
            // Access the application context and create result variables.
            Models.ApplicationDbContext context = new ApplicationDbContext();
            IdentityResult IdRoleResult;
            IdentityResult IdUserResult;

            // Create a RoleStore object by using the ApplicationDbContext object.
            // The RoleStore is only allowed to contain IdentityRole objects.
            var roleStore = new RoleStore<IdentityRole>(context);

            // Create a RoleManager object that is only allowed to contain IdentityRole objects.
            // When creating the RoleManager object, you pass in (as a parameter) a new RoleStore object.
            var roleMgr = new RoleManager<IdentityRole>(roleStore);

            // Then, you create the "canEdit" role if it doesn't already exist.
            if (!roleMgr.RoleExists("administrator"))
            {
                IdRoleResult = roleMgr.Create(new IdentityRole { Name = "administrator" });
            }
            // Then, you create the "canEdit" role if it doesn't already exist.
            if (!roleMgr.RoleExists("manager"))
            {
                IdRoleResult = roleMgr.Create(new IdentityRole { Name = "manager" });
            }
            // Then, you create the "canEdit" role if it doesn't already exist.
            if (!roleMgr.RoleExists("member"))
            {
                IdRoleResult = roleMgr.Create(new IdentityRole { Name = "member" });
            }
            // Create a UserManager object based on the UserStore object and the ApplicationDbContext
            // object. Note that you can create new objects and use them as parameters in
            // a single line of code, rather than using multiple lines of code, as you did
            // for the RoleManager object.
            var userMgr = new UserManager<ApplicationUser>(new UserStore<ApplicationUser>(context));
            var appUser = new ApplicationUser
            {
                UserName = "[email protected]",
                Email = "[email protected]"
            };
            IdUserResult = userMgr.Create(appUser, "pass1234");

            // If the new "canEdit" user was successfully created,
            // add the "canEdit" user to the "canEdit" role.
            if (!userMgr.IsInRole(userMgr.FindByEmail("[email protected]").Id, "administrator"))
            {
                IdUserResult = userMgr.AddToRole(userMgr.FindByEmail("[email protected]").Id, "administrator");
            }
        }
开发者ID:dbtdsilva,项目名称:edc-aspnet,代码行数:49,代码来源:RoleAction.cs

示例13: SeedDbUsers

        public static void SeedDbUsers(ApplicationDbContext context, List<Image> userImages)
        {
            Users = new List<ApplicationUser>();

            var userManager = new UserManager<ApplicationUser>(new UserStore<ApplicationUser>(context));
            var roleManager = new RoleManager<IdentityRole>(new RoleStore<IdentityRole>(context));

            if (!roleManager.RoleExists("Admin"))
            {
                roleManager.Create(new IdentityRole("Admin"));
            }

            var admin = new ApplicationUser
            {
                UserName = "[email protected]",
                PasswordHash = new PasswordHasher().HashPassword("admin"),
                SecurityStamp = Guid.NewGuid().ToString("D"),
                FirstName = "Admin",
                LastName = "Adminski",
                Email = "[email protected]"
            };

            Admin = admin;
            userManager.Create(admin);
            userManager.AddToRole(admin.Id, "Admin");

            if (!roleManager.RoleExists("User"))
            {
                roleManager.Create(new IdentityRole("User"));
            }

            for (int i = 0; i < 20; i++)
            {
                var user = new ApplicationUser
                {
                    UserName = "user" + i + "@artist.com",
                    PasswordHash = new PasswordHasher().HashPassword("user" + i),
                    SecurityStamp = Guid.NewGuid().ToString("D"),
                    FirstName = "FirstName" + i,
                    LastName = "LastName" + i,
                    Email = "user" + i + "@artist.com",
                    Images = userImages[0]
                };

                userManager.Create(user);
                userManager.AddToRole(admin.Id, "User");
                Users.Add(user);
            }
        }
开发者ID:iliantova,项目名称:MVC-Project-ArtistReview,代码行数:49,代码来源:SeedUsers.cs

示例14: Application_Start

        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);

            // Tạo role sẵn
            var roleManager = new RoleManager<IdentityRole>(new RoleStore<IdentityRole>(new ApplicationDbContext()));

            List<string> roleNameList = new List<string> { "Admin"
                                                         , "Designer"
                                                         , "Mod"
                                                         , "Uploader"
                                                         , "Subteam"
                                                         , "Subber"
                                                         , "VIP"
                                                         , "Member" };
            foreach (string roleName in roleNameList)
            {
                if (!roleManager.RoleExists(roleName))
                {
                    var newRole = new IdentityRole();
                    newRole.Name = roleName;
                    roleManager.Create(newRole);
                }
            }
        }
开发者ID:taihdse60630,项目名称:a4s,代码行数:28,代码来源:Global.asax.cs

示例15: Create

        public ActionResult Create(ClientViewModel client)
        {
            if (!ModelState.IsValid) return View();

            //Register user and SingIn
            var accountController = new AccountController {ControllerContext = this.ControllerContext};
            var user = accountController.RegisterAccount(new RegisterViewModel() { Email = client.Email, Password = client.Password });
            accountController.SignInManager.SignIn(user, isPersistent: false, rememberBrowser: false);

            //Add user to client role
            var userStore = new UserStore<ApplicationUser>(_context);
            var userManager = new UserManager<ApplicationUser>(userStore);
            var roleStore = new RoleStore<IdentityRole>(_context);
            var roleManager = new RoleManager<IdentityRole>(roleStore);
            
            if (!roleManager.RoleExists("Client")) 
                roleManager.Create(new IdentityRole("Client"));
            
            userManager.AddToRole(user.Id, "Client");

            //Register client
            if (string.IsNullOrWhiteSpace(user.Id)) return View();
            _context.Clients.Add(new Client()
            {
                Id = user.Id,
                Name = client.Name,
                Age = client.Age
            });
            _context.SaveChanges();

            return RedirectToAction("Index", "Home");
        }
开发者ID:fabiopsouza,项目名称:Learning.AspNetMVC,代码行数:32,代码来源:ClientController.cs


注:本文中的RoleManager.RoleExists方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。