→ 🚀What's New? Join Us for the Fall Product Launch! Register Now !
02-20-2015 08:05 PM
Solved! Go to Solution.
02-27-2015 02:13 PM
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="test.aspx.cs" Inherits="WidgetsCustom_test" %>
<%@ Import Namespace="LS" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<%
Dictionary<string, WebUser> sessions = new Dictionary<string, WebUser>();
lock (Application["lock_runningSessions"]) {
Dictionary<string, WebUser> dic = (Dictionary<string, WebUser>)Application["runningSessions"];
foreach (KeyValuePair<string, WebUser> pair in dic) {
sessions.Add(pair.Key, pair.Value);
}
}
%>
<div class="configbar">Current Logged on Users</div>
<table id="loggedonusers" cellspacing="0" cellpadding="0" class="configtable">
<thead>
<tr>
<th class="dummy"></th>
<th> </th>
<th>Displayname</th>
<th>IP Address</th>
<th>Web Roles</th>
</tr>
</thead>
<tbody>
<% foreach (KeyValuePair<string, WebUser> pair in sessions)
{
string windowsgroups = "Windows groups: \n";
foreach (string s in pair.Value.WindowsGroups)
{
windowsgroups += ("\t" + s + "\n");
}
%>
<tr title="<%:windowsgroups %>">
<td class="dummy"></td>
<td class="lock"><img src="../configuration/../images/user-white.png" width="16" height="16" /></td>
<td class="lock"><a href="<%=ResolveUrl("~/")%>User.aspx?username=<%= HttpUtility.UrlEncode(pair.Value.UserName) %>&userdomain=<%= HttpUtility.UrlEncode(pair.Value.UserDomain) %>" class="popup" rel="u||<%= HttpUtility.UrlEncode(pair.Value.UserDomain) %>||<%= HttpUtility.UrlEncode(pair.Value.UserName) %>" style="color: #0084B4;"><%: pair.Value.Displayname%></a></td>
<td class="lock"><%: pair.Value.IP %></td>
<td class="lock">
<% for (int teller = 0; teller < pair.Value.WebRoles.Count; teller++)
{
if (teller > 0) { %><%: ", " %><% } %>
<%: pair.Value.WebRoles[teller]%>
<% } %>
</td>
</tr>
<% } %>
</tbody>
</table>
</div>
</form>
</body>
</html>
02-27-2015 02:13 PM
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="test.aspx.cs" Inherits="WidgetsCustom_test" %>
<%@ Import Namespace="LS" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<%
Dictionary<string, WebUser> sessions = new Dictionary<string, WebUser>();
lock (Application["lock_runningSessions"]) {
Dictionary<string, WebUser> dic = (Dictionary<string, WebUser>)Application["runningSessions"];
foreach (KeyValuePair<string, WebUser> pair in dic) {
sessions.Add(pair.Key, pair.Value);
}
}
%>
<div class="configbar">Current Logged on Users</div>
<table id="loggedonusers" cellspacing="0" cellpadding="0" class="configtable">
<thead>
<tr>
<th class="dummy"></th>
<th> </th>
<th>Displayname</th>
<th>IP Address</th>
<th>Web Roles</th>
</tr>
</thead>
<tbody>
<% foreach (KeyValuePair<string, WebUser> pair in sessions)
{
string windowsgroups = "Windows groups: \n";
foreach (string s in pair.Value.WindowsGroups)
{
windowsgroups += ("\t" + s + "\n");
}
%>
<tr title="<%:windowsgroups %>">
<td class="dummy"></td>
<td class="lock"><img src="../configuration/../images/user-white.png" width="16" height="16" /></td>
<td class="lock"><a href="<%=ResolveUrl("~/")%>User.aspx?username=<%= HttpUtility.UrlEncode(pair.Value.UserName) %>&userdomain=<%= HttpUtility.UrlEncode(pair.Value.UserDomain) %>" class="popup" rel="u||<%= HttpUtility.UrlEncode(pair.Value.UserDomain) %>||<%= HttpUtility.UrlEncode(pair.Value.UserName) %>" style="color: #0084B4;"><%: pair.Value.Displayname%></a></td>
<td class="lock"><%: pair.Value.IP %></td>
<td class="lock">
<% for (int teller = 0; teller < pair.Value.WebRoles.Count; teller++)
{
if (teller > 0) { %><%: ", " %><% } %>
<%: pair.Value.WebRoles[teller]%>
<% } %>
</td>
</tr>
<% } %>
</tbody>
</table>
</div>
</form>
</body>
</html>
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now