ISCSessionCollection Interface
The following table contains information on the ISCSessionCollection interface:
|
Signature |
Description |
Valid Arguments |
|---|---|---|
|
VARIANT_BOOL Remove(VARIANT SessionId) |
Removes a Session object from the collection |
SessionId:
|
Example 28
The following example illustrates how to close a session using C++. It assumes that there is a Session object and the session is open. The examples use an Application object from Example 1:
void CloseSessions( ISCApplicationPtr & scAppPtr )
{
ISCSessionCollectionPtr scSessionColPtr = scAppPtr->GetSessions();
ISCSessionPtr scSessionPtr = scSessionColPtr->GetItem(COleVariant(0L))
// close the sessions
scSessionPtr->Close(); // close a single session
scSessionColPtr->Clear(); // clear the collection of sessions
}
The following example illustrates how to close a session using Visual Basic .NET. It assumes that there is a Session object and the session is open. The examples use an Application object from Example 1:
Public Sub CloseSessions( scApp As SCAPI.Application )
Dim scSessionCol As SCAPI.Sessions
scSessionCol = scApp.Sessions
Dim scSession As SCAPI.Session
For Each scSession In scSessionCol
scSession.Close
Next
While (scSessionCol.Count > 0)
scSessionCol.Remove (0)
End
End Sub
|
Copyright © 2025 Quest Software, Inc. |