ActiveDirectoryMembershipUser.LastActivityDate Propriedade

Definição

Gera uma exceção NotSupportedException em todos os casos.Throws a NotSupportedException exception in all cases.

public:
 virtual property DateTime LastActivityDate { DateTime get(); void set(DateTime value); };
public override DateTime LastActivityDate { get; set; }
member this.LastActivityDate : DateTime with get, set
Public Overrides Property LastActivityDate As DateTime

Valor da propriedade

DateTime

Sempre lança uma exceção NotSupportedException.Always throws a NotSupportedException exception.

Exceções

qualquer tentativa de obter ou definir a propriedade LastActivityDate.any attempt to get or set the LastActivityDate property.

Exemplos

O exemplo de código a seguir demonstra como determinar se o tipo subjacente de um usuário de associação é ActiveDirectoryMembershipUser e evitar lançar um NotSupportedException para acessar a LastActivityDate propriedade.The following code example demonstrates how to determine whether the underlying type of a membership user is ActiveDirectoryMembershipUser, and to avoid throwing a NotSupportedException for accessing the LastActivityDate property. Para obter o código completo necessário para executar o exemplo, consulte a seção de exemplo do ActiveDirectoryMembershipUser tópico Visão geral da classe.For the full code required to run the example, see the Example section of the ActiveDirectoryMembershipUser class overview topic.

if (user is ActiveDirectoryMembershipUser)
{
  lastLoginDate.Text = "Not available";
  lastActivityDate.Text = "Not available";
}
else
{
  lastLoginDate.Text = user.LastLoginDate.ToShortDateString();
  lastActivityDate.Text = user.LastActivityDate.ToShortDateString();
}
If TypeOf (user) Is ActiveDirectoryMembershipUser Then
  lastLoginDate.Text = "Not available"
  lastActivityDate.Text = "Not available"
Else
  lastLoginDate.Text = user.LastLoginDate.ToString()
  lastActivityDate.Text = user.LastActivityDate.ToString()
End If

Comentários

A LastActivityDate classe não dá suporte à propriedade ActiveDirectoryMembershipUser .The LastActivityDate property is not supported by the ActiveDirectoryMembershipUser class. Tentar obter ou definir o valor sempre lançará um NotSupportedException .Attempting to get or set the value will always throw a NotSupportedException.

Aplica-se a