Iam using the OpenConnection开发者_运维问答 from CertAdm.dll to open a connection.
Like this:
             CERTADMINLib.CCertView connection = new CERTADMINLib.CCertViewClass();
I was wondering how can I close this connection when Iam done with it? I havent found anything about closing the connection.
Thnx in advance.
It's good practice to use "using" pattern for those kind of connections:
  using (CERTADMINLib.CCertView connection = new CERTADMINLib.CCertViewClass())
  {
    // do something ...
  }
after the last brace connections are disposed.
Close the connection so:
ICertView2 certView = null;
IEnumCERTVIEWROW row = null;
try
{
    certView = new CCertView();
    certView.OpenConnection( _strCAConfig );
    certView.SetResultColumnCount( 1 );
    certView.SetResultColumn( certView.GetColumnIndex( 0, "RequestID" ) );
    row = certView.OpenView();
    row.Next();
    return row.GetMaxIndex();
}
finally
{
    Marshal.ReleaseComObject( row );
    Marshal.ReleaseComObject( certView );
}
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论