vb System.Web.ClientServices.Providers.ClientFormsAuthenticationMembershipProvider类(方法)实例源码

下面列出了vb System.Web.ClientServices.Providers.ClientFormsAuthenticationMembershipProvider 类(方法)源码代码实例,从而了解它的用法。

作者:VB.NET开发    项目:System.Web.ClientServices.Provider   
Private Function ValidateUsingCredentialsProvider() As Boolean

    Dim isAuthorized As Boolean = False

    Try

        Dim authProvider As ClientFormsAuthenticationMembershipProvider = _
            CType(System.Web.Security.Membership.Provider,  _
            ClientFormsAuthenticationMembershipProvider)

        ' Call ValidateUser with empty strings in order to display the 
        ' login dialog box configured as a credentials provider.
        isAuthorized = authProvider.ValidateUser(String.Empty, String.Empty)

    Catch ex As System.Net.WebException

        MessageBox.Show("Unable to access the authentication service.", _
            "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning)

    End Try

    If Not isAuthorized Then

        MessageBox.Show("Unable to authenticate.", "Not logged in", _
            MessageBoxButtons.OK, MessageBoxIcon.Error)
        Application.Exit()

    End If

    Return isAuthorized

End Function


问题


面经


文章

微信
公众号

扫码关注公众号