WebSecurity- IsCurrentUser()
❮WebSecurity
意味
IsCurrentUser()メソッドは、指定されたユーザー名をログインしたユーザーのユーザー名と比較します。
C#およびVB構文
WebSecurity.IsCurrentUser(userName)
パラメーター
Parameter | Type | Description |
---|---|---|
userName | String | The user name to compare |
戻り値
Type | Description |
---|---|
Boolean | true if the userName parameter matches the logged in user, otherwise false |
エラーと例外
次の場合、 WebSecurityオブジェクトにアクセスすると、 InvalidOperationExceptionがスローされます。
- InitializeDatabaseConnection()メソッドが呼び出されていません
- SimpleMembershipが初期化されていない(またはWebサイト構成で無効になっている)
❮WebSecurity