WindowsClaimSet.Dispose 方法


釋放 WindowsClaimSet 所使用的所有資源。Releases all resources used by the WindowsClaimSet.

 virtual void Dispose();
public void Dispose ();
abstract member Dispose : unit -> unit
override this.Dispose : unit -> unit
Public Sub Dispose ()



當您完成使用 Dispose 後,請呼叫 WindowsClaimSet 方法。Call the Dispose method when you are finished using the WindowsClaimSet. Dispose 方法會將 WindowsClaimSet 保留在無法使用的狀態。The Dispose method leaves the WindowsClaimSet in an unusable state. 在呼叫 Dispose 方法後,您必須釋放所有對 WindowsClaimSet 的參考,讓記憶體回收行程可以取回 WindowsClaimSet 所佔用的記憶體。After calling the Dispose method, you must release all references to the WindowsClaimSet so that the garbage collector can reclaim the memory that the WindowsClaimSet occupied. 如需詳細資訊,請參閱清除非受控資源執行 Dispose 方法For more information, see Cleaning Up Unmanaged Resources and Implementing a Dispose Method.


在您釋放最後一個 Dispose 參考之前,請務必呼叫 WindowsClaimSet 方法。Always call the Dispose method before you release your last reference to the WindowsClaimSet. 否則,在記憶體回收行程呼叫 WindowsClaimSet 物件的 Finalize 方法之前,不會釋放它正在使用的資源。Otherwise, the resources it is using are not freed until the garbage collector calls the WindowsClaimSet object's Finalize method.