ASP.NET Identity : Generate random password

前端 未结 6 1093
天涯浪人
天涯浪人 2021-02-02 10:50

Is there any built in function that creates random passwords ? Asp.net simple memebership used to have a similar method

6条回答
  •  独厮守ぢ
    2021-02-02 11:53

    If you are using .NET Framework and System.Web.Security.Membership is available to you:

    Check here:

     string password = Membership.GeneratePassword(12, 1);
    

    Note that this class is not available in .NET Standard or .NET Core.

提交回复
热议问题