AsymmetricAlgorithm.Clear 方法

定義

釋放 AsymmetricAlgorithm 類別所使用的所有資源。Releases all resources used by the AsymmetricAlgorithm class.

public:
 void Clear();
public void Clear ();
member this.Clear : unit -> unit
Public Sub Clear ()

範例

下列程式碼範例示範如何呼叫 Clear 方法,以釋放目前物件的資源 customCryptoThe following code example demonstrates how to call the Clear method to release the resources of the current customCrypto object. 這個程式碼範例是針對類別提供之較大範例的一部分 AsymmetricAlgorithmThis code example is part of a larger example provided for the AsymmetricAlgorithm class.

customCryptoAlgorithm->Clear();
customCrypto.Clear();
customCrypto.Clear()

備註

這個方法是簡單的 IDisposable.Dispose 方法呼叫。This method is a simple call to the IDisposable.Dispose method.

呼叫可 Dispose 讓類別用來重新配置的資源,以 AsymmetricAlgorithm 供其他用途使用。Calling Dispose allows the resources used by the AsymmetricAlgorithm class to be reallocated for other purposes. 如需的詳細資訊 Dispose ,請參閱 清除非受控資源For more information about Dispose, see Cleaning Up Unmanaged Resources.

適用於