Share via


FormsAuthenticationCredentials.PasswordFormat 屬性

定義

取得或設定密碼格式。

public:
 property System::Web::Configuration::FormsAuthPasswordFormat PasswordFormat { System::Web::Configuration::FormsAuthPasswordFormat get(); void set(System::Web::Configuration::FormsAuthPasswordFormat value); };
[System.Configuration.ConfigurationProperty("passwordFormat", DefaultValue=System.Web.Configuration.FormsAuthPasswordFormat.SHA1)]
public System.Web.Configuration.FormsAuthPasswordFormat PasswordFormat { get; set; }
[<System.Configuration.ConfigurationProperty("passwordFormat", DefaultValue=System.Web.Configuration.FormsAuthPasswordFormat.SHA1)>]
member this.PasswordFormat : System.Web.Configuration.FormsAuthPasswordFormat with get, set
Public Property PasswordFormat As FormsAuthPasswordFormat

屬性值

其中一個 FormsAuthPasswordFormat 值。

屬性

範例

下列程式碼範例示範如何存取 PasswordFormat 屬性。 請參閱類別主題中的 FormsAuthenticationCredentials 程式碼範例,以瞭解如何取得區段。

// Get the current PasswordFormat property value.
FormsAuthPasswordFormat currentPasswordFormat =
formsAuthenticationCredentials.PasswordFormat;

// Set the PasswordFormat property value.
// This example uses the SHA1 algorithm.
// Due to collision problems with SHA1, Microsoft recommends SHA256 or better.
formsAuthenticationCredentials.PasswordFormat = 
    FormsAuthPasswordFormat.SHA1;
' Get the current PasswordFormat property value.
  Dim currentPasswordFormat _
  As FormsAuthPasswordFormat = _
  formsAuthenticationCredentials.PasswordFormat


' Set the PasswordFormat property value.
' This example uses the SHA1 algorithm.
' Due to collision problems with SHA1, Microsoft recommends SHA256 or better.
  formsAuthenticationCredentials.PasswordFormat = _
  FormsAuthPasswordFormat.SHA1

適用於

另請參閱