Table of Contents

Class ExchangeCredentials

Namespace
Microsoft.Exchange.WebServices.Data
Assembly
Microsoft.Exchange.WebServices.dll

Base class of Exchange credential types.

public abstract class ExchangeCredentials
Inheritance
ExchangeCredentials
Derived
Inherited Members

Constructors

ExchangeCredentials()

protected ExchangeCredentials()

Operators

implicit operator ExchangeCredentials(CredentialCache)

Performs an implicit conversion from CredentialCache to ExchangeCredentials. This allows a CredentialCache object to be implictly converted to an ExchangeCredential which is useful when setting credentials on an ExchangeService.

public static implicit operator ExchangeCredentials(CredentialCache credentials)

Parameters

credentials CredentialCache

The credentials.

Returns

ExchangeCredentials

The result of the conversion.

Examples

Using these credentials:

CredentialCache credentials = new CredentialCache();
credentials.Add(new Uri("http://www.contoso.com/"),"Basic",new NetworkCredential(user,pwd));
credentials.Add(new Uri("http://www.contoso.com/"),"Digest", new NetworkCredential(user,pwd,domain));

This operator allows you to type:

service.Credentials = credentials;

instead of:

service.Credentials = new WebCredentials(credentials);

implicit operator ExchangeCredentials(NetworkCredential)

Performs an implicit conversion from NetworkCredential to ExchangeCredentials. This allows a NetworkCredential object to be implictly converted to an ExchangeCredential which is useful when setting credentials on an ExchangeService.

public static implicit operator ExchangeCredentials(NetworkCredential credentials)

Parameters

credentials NetworkCredential

The credentials.

Returns

ExchangeCredentials

The result of the conversion.

Examples

This operator allows you to type:

service.Credentials = new NetworkCredential("username","password");

instead of:

service.Credentials = new WebCredentials(new NetworkCredential("username","password"));