Getting on-line user data

  Previous topic Next topic JavaScript is required for the print function Mail us feedback on this topic! Mail us feedback on this topic!  

The following sample code shows how you can get a DataSet containing on-line users filtered by various parameters:

 

[C#]

 

using System.Data;

using CMS.CMSHelper;

 

...

 

        string where = "UserID > 53";

        int topN = 10;

        string orderBy = "UserName";

        string columns = "UserName, Email";

 

        // Only users accessing the specified location (alias path) will be selected

        string location = "/Home";

 

        string siteName = "CorporateSite";

        bool includeHidden = true;

        bool includeKicked = false;

 

        // Get DataSet of online users according to the given parameters

      DataSet ds = SessionManager.GetOnlineUsers(where, orderBy, topN, location, siteName, includeHidden, includeKicked);

 

      DataSet ds2 = SessionManager.GetOnlineUsers(where, orderBy, topN, columns, location, siteName, includeHidden, includeKicked);

 

Page url: http://devnet.kentico.com/docs/5_5r2/devguide/index.html?api_getting_on_line_user_data.htm