Have you got another idea to get this list of data?
I would like to show all my code because I think this can be much more easier for you. In this code you can see how I connect with role file.
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Microsoft.Interop.Security.AzRoles;
using System.Runtime.InteropServices;
using System.Security.Principal;
using System.Collections.Generic;
namespace Authman
{
public partial class WebForm1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
// See the following table for other sample connection strings.
string connectionString = @"msxml://c:\plik.xml";
AzAuthorizationStoreClass azStore = new AzAuthorizationStoreClass();
azStore.Initialize(0, connectionString, null);
IAzApplication2 azApplication = azStore.OpenApplication2("SatheeshApp", null);
IAzClientContext3 clientContext = (IAzClientContext3)azApplication.InitializeClientContextFromToken((ulong)WindowsIdentity.GetCurrent().Token, null);
// Use the default application scope.
string[] roles = (string[])clientContext.GetRoles("");
foreach (string role in roles)
{
Span3.InnerHtml += role.ToString() + "</br>";
}
}
}
}