Compartir a través de


xSession.newmethod Method

Definition

Overloads

newmethod(Int32, Boolean)
newmethod()

Instantiates the xSession object, either for current session or for the session ID passed in as a parameter.

newmethod(Int32)

newmethod(Int32, Boolean)

public:
 void newmethod(int _sessionId, bool _checkSession);
public void newmethod (int _sessionId, bool _checkSession);
override this.newmethod : int * bool -> unit
Public Sub newmethod (_sessionId As Integer, _checkSession As Boolean)

Parameters

_sessionId
Int32

A boolean flag that, if set to true, checks to determine whether the session specified by the _SessionId parameter exists. The operation that checks whether a session exists might use a lot of system resources. This parameter is therefore set to false by default.

_checkSession
Boolean

A boolean flag that, if set to true, checks to determine whether the session specified by the _SessionId parameter exists. The operation that checks whether a session exists might use a lot of system resources. This parameter is therefore set to false by default.

Applies to

newmethod()

Instantiates the xSession object, either for current session or for the session ID passed in as a parameter.

protected:
 override void newmethod();
protected override void newmethod ();
override this.newmethod : unit -> unit
Protected Overrides Sub newmethod ()

Remarks

The following example returns a count of all the active sessions.

server static Integer getAllOnlineUserCount() 
{ 
    int      counter; 
    int      num = 0; 
    int      maxSessions = Info::licensedUsersTotal(); 
    xSession session; 
    UserInfo userInfo; 
    for(counter = 1; counter < maxSessions;counter++) 
    { 
        session = new xSession(counter, true); 
        if(session && session.userId()) 
        { 
            select firstonly userInfo 
                where userInfo.Id == session.userId(); 
            if (userInfo) 
                num++; 
        } 
    } 
    return num; 
}

Applies to

newmethod(Int32)

public:
 void newmethod(int num1);
public void newmethod (int num1);
override this.newmethod : int -> unit
Public Sub newmethod (num1 As Integer)

Parameters

num1
Int32

Applies to