當前位置: 首頁>>代碼示例>>VB.NET>>正文


VB.NET PassportIdentity.GetIsAuthenticated方法代碼示例

本文整理匯總了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)
開發者ID:VB.NET開發者,項目名稱:System.Web.Security,代碼行數:23,代碼來源:PassportIdentity.GetIsAuthenticated


注:本文中的System.Web.Security.PassportIdentity.GetIsAuthenticated方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。