Click to Rate and Give Feedback
TechNet
TechNet Library
Collapse All/Expand All Collapse All
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
.NET Framework Class Library
ClientFormsAuthenticationCredentials Class

Represents user login information for forms authentication by using client application services.

Namespace:  System.Web.ClientServices.Providers
Assembly:  System.Web.Extensions (in System.Web.Extensions.dll)
Visual Basic (Declaration)
Public Class ClientFormsAuthenticationCredentials
Visual Basic (Usage)
Dim instance As ClientFormsAuthenticationCredentials
C#
public class ClientFormsAuthenticationCredentials
Visual C++
public ref class ClientFormsAuthenticationCredentials
JScript
public class ClientFormsAuthenticationCredentials

The ClientFormsAuthenticationCredentials class is used by the IClientFormsAuthenticationCredentialsProvider interface. When you implement this interface, you must return a populated instance of this class in your GetCredentials implementation.

The following example code demonstrates how to implement the IClientFormsAuthenticationCredentialsProvider..::.GetCredentials method, which returns an instance of this class. In this example, the GetCredentials method is part of a login dialog box class. The method displays the dialog box, and then returns a ClientFormsAuthenticationCredentials instance initialized with the user-specified values.

Visual Basic
Public Function GetCredentials() As  _
    ClientFormsAuthenticationCredentials Implements _
    IClientFormsAuthenticationCredentialsProvider.GetCredentials

    If Me.ShowDialog() = DialogResult.OK Then
        Return New ClientFormsAuthenticationCredentials( _
            UsernameTextBox.Text, PasswordTextBox.Text, _
            rememberMeCheckBox.Checked)
    Else
        Return Nothing
    End If

End Function
C#
public ClientFormsAuthenticationCredentials GetCredentials()
{
    if (this.ShowDialog() == DialogResult.OK)
    {
        return new ClientFormsAuthenticationCredentials(
            usernameTextBox.Text, passwordTextBox.Text,
            rememberMeCheckBox.Checked);
    }
    else
    {
        return null;
    }
}
System..::.Object
  System.Web.ClientServices.Providers..::.ClientFormsAuthenticationCredentials
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2010 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker