xSession.userId Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Retrieves the user ID that this session is logged on with.
public:
virtual System::String ^ userId();
public virtual string userId ();
abstract member userId : unit -> string
override this.userId : unit -> string
Public Overridable Function userId () As String
Returns
The ID for the user of the session.
Remarks
The following example determines whether a particular user is online.
server static boolean isUserOnline(userId userId)
{
xSession session;
int counter;
int maxSessions = Info::licensedUsersTotal();
if (!userId)
{
return false;
}
for(counter = 1; counter < maxSessions;counter++)
{
session = new xSession(counter, true);
if(session && session.userId() == userId)
{
return true;
}
}
return false;
}