X509WindowsSecurityToken.Dispose 方法

定义

释放由 X509WindowsSecurityToken 使用的所有资源。Releases all resources used by the X509WindowsSecurityToken.

public:
 override void Dispose();
public override void Dispose ();
override this.Dispose : unit -> unit
Public Overrides Sub Dispose ()

注解

使用完 Dispose 后调用 X509WindowsSecurityToken 方法。Call the Dispose method when you are finished using the X509WindowsSecurityToken. Dispose 方法使 X509WindowsSecurityToken 处于不可用状态。The Dispose method leaves the X509WindowsSecurityToken in an unusable state. 调用 Dispose 方法后,必须释放对 X509WindowsSecurityToken 的所有引用,这样垃圾收集器才能收回 X509WindowsSecurityToken 占用的内存。After calling the Dispose method, you must release all references to the X509WindowsSecurityToken so the garbage collector can reclaim the memory that the X509WindowsSecurityToken was occupying.

备注

每次释放对 Dispose 的最后一个引用之前,均应调用 X509WindowsSecurityToken 方法。Always call the Dispose method before you release your last reference to the X509WindowsSecurityToken. 否则,在垃圾回收器调用 X509WindowsSecurityToken 对象的 Finalize 方法之前,该对象正在使用的资源不会被释放。Otherwise, the resources it is using will not be freed until the garbage collector calls the X509WindowsSecurityToken object's Finalize method.

适用于