WebSecurity - 계정 만들기()
❮ 웹보안
정의
CreateAccount() 메서드 는 사용자 이름과 암호를 사용하여 사용자 데이터베이스에 새 계정을 만들고 선택적으로 사용자가 계정을 명시적으로 확인해야 하는지 여부를 지정할 수 있습니다.
C# 및 VB 구문
WebSecurity.CreateAccount(username,
password, requireConfirmation)
매개변수
Parameter | Type | Description |
---|---|---|
userName | String | The user name |
password | String | The user password |
requireConfirmation | Boolean | true if the account must be confirmed using the token return value, default is false. |
반환 값
Type | Description |
---|---|
String | A token that can be sent to the user to confirm the account. |
오류 및 예외
WebSecurity 개체 에 대한 모든 액세스는 다음과 같은 경우 InvalidOperationException 을 발생시킵니다 .
- InitializeDatabaseConnection() 메서드가 호출되지 않았습니다 .
- SimpleMembership 이 초기화되지 않았습니다(또는 웹사이트 구성에서 비활성화됨).
CreateAccount() 메서드는 다음 과 같은 경우 에도 MembershipCreateUserException 을 throw 합니다.
- 사용자 이름이 비어 있습니다.
- 사용자 이름에 이미 멤버십 계정이 있습니다.
- 비밀번호가 비어있습니다
- 비밀번호가 너무 깁니다.
- 데이터베이스 작업 실패
❮ 웹보안