WebSecurity - IsCurrentUser()
❮ Sicurezza web
Definizione
Il metodo IsCurrentUser() confronta un nome utente fornito con il nome utente dell'utente connesso.
Sintassi C# e VB
WebSecurity.IsCurrentUser(userName)
Parametri
Parameter | Type | Description |
---|---|---|
userName | String | The user name to compare |
Valore di ritorno
Type | Description |
---|---|
Boolean | true if the userName parameter matches the logged in user, otherwise false |
Errori ed eccezioni
Qualsiasi accesso all'oggetto WebSecurity genera un'eccezione InvalidOperationException se:
- Il metodo InitializeDatabaseConnection() non è stato chiamato
- SimpleMembership non è inizializzato (o disabilitato nella configurazione del sito Web)
❮ Sicurezza web