本文整理匯總了VB.NET中System.Web.Security.PassportIdentity.GetIsAuthenticated方法的典型用法代碼示例。如果您正苦於以下問題:VB.NET PassportIdentity.GetIsAuthenticated方法的具體用法?VB.NET PassportIdentity.GetIsAuthenticated怎麽用?VB.NET PassportIdentity.GetIsAuthenticated使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。
在下文中一共展示了PassportIdentity.GetIsAuthenticated方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的VB.NET代碼示例。
示例1: If
Dim identity As PassportIdentity = Me.Context.User.Identity
' Determine whether the user is already signed in with a valid
' and current ticket. Passing -1 for the parameter values
' indicates the default values will be used.
If (identity.GetIsAuthenticated(-1, -1, -1)) Then
Me.Response.Write("Welcome to the site.<br /><br />")
' Print the Passport sign in button on the screen.
Me.Response.Write(identity.LogoTag2())
' Make sure the user has core profile information before
' trying to access it.
If (identity.HasProfile("core")) Then
Me.Response.Write("<b>You have been authenticated as " & _
"Passport identity:" & identity.Name & "</b></p>")
End If
' Determine whether the user has a ticket.
ElseIf identity.HasTicket Then
' If the user has a ticket but wasn't authenticated, that
' means the ticket is stale, so the login needs to be refreshed.
' Passing true as the fForceLogin parameter value indicates that
' silent refresh will be accepted.
identity.LoginUser(Nothing, -1, True, Nothing, -1, Nothing, _
-1, True, Nothing)