Click here to Skip to main content
15,949,686 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Ajax Issue Pin
Vasudevan Deepak Kumar6-Feb-08 1:40
Vasudevan Deepak Kumar6-Feb-08 1:40 
JokeRe: Ajax Issue Pin
Ri Qen-Sin6-Feb-08 3:18
Ri Qen-Sin6-Feb-08 3:18 
GeneralRe: Ajax Issue Pin
Ri Qen-Sin6-Feb-08 3:19
Ri Qen-Sin6-Feb-08 3:19 
QuestionIIS/ASP.NET High Load Pin
Vasudevan Deepak Kumar5-Feb-08 5:41
Vasudevan Deepak Kumar5-Feb-08 5:41 
GeneralRe: IIS/ASP.NET High Load Pin
Sam Xavier13-Feb-08 23:34
Sam Xavier13-Feb-08 23:34 
GeneralConsole.WriteLine and Response.Write Pin
Brendan Vogt5-Feb-08 4:23
Brendan Vogt5-Feb-08 4:23 
GeneralRe: Console.WriteLine and Response.Write Pin
pmarfleet5-Feb-08 5:34
pmarfleet5-Feb-08 5:34 
QuestionWindows Authentication Help Needed Pin
Brendan Vogt5-Feb-08 4:21
Brendan Vogt5-Feb-08 4:21 
Hi there,

I have never worked with windows authentication in a web application. I am using ASP.NET and C# 2.0. I need to display everything that there is to display

about the currently logged in user. I have no idea where to start. Please can someone advise?

I have the following code, it displays the user and some roles, not if it is all the roles, but I was told to display groups and everything else associated

with the currently logged in user.

My code:

AppDomain.CurrentDomain.SetPrincipalPolicy(PrincipalPolicy.WindowsPrincipal);
WindowsPrincipal myPrincipal = (WindowsPrincipal)Thread.CurrentPrincipal;

Response.Write(myPrincipal.Identity.Name + "<br /><br />");

// Use IsInRole to determine the role of the current user
Array wbirFields = Enum.GetValues(typeof(WindowsBuiltInRole));
foreach (object roleName in wbirFields)
{
try
{
Response.Write(roleName + "&nbsp;&nbsp;" + myPrincipal.IsInRole((WindowsBuiltInRole)roleName) + "<br />");
}
catch(Exception)
{
Response.Write(roleName + ": Could not obtain role for this RID.");
}
}

My results after running the code is:

DOMAIN\username

Administrator False
User True
Guest False
PowerUser False
AccountOperator False
SystemOperator False
PrintOperator False
BackupOperator False
Replicator False

But I need everything!!

Thanks
Brendan
Generalreading HTML file and Append text Pin
gottimukkala5-Feb-08 3:44
gottimukkala5-Feb-08 3:44 
Generalreading HTML file and Append text Pin
gottimukkala5-Feb-08 3:44
gottimukkala5-Feb-08 3:44 
Generaluploading asp.net files to a web server Pin
eyeseetee5-Feb-08 3:39
eyeseetee5-Feb-08 3:39 
GeneralRe: uploading asp.net files to a web server Pin
eggsovereasy5-Feb-08 9:12
eggsovereasy5-Feb-08 9:12 
GeneralRe: uploading asp.net files to a web server Pin
eyeseetee5-Feb-08 21:45
eyeseetee5-Feb-08 21:45 
QuestionDrop Down Lists on web pages problem Pin
Anoop Brijmohun5-Feb-08 2:53
Anoop Brijmohun5-Feb-08 2:53 
GeneralRe: Drop Down Lists on web pages problem Pin
bokuceres5-Feb-08 17:31
bokuceres5-Feb-08 17:31 
GeneralRe: Drop Down Lists on web pages problem Pin
Anoop Brijmohun5-Feb-08 22:07
Anoop Brijmohun5-Feb-08 22:07 
GeneralRe: Drop Down Lists on web pages problem Pin
bokuceres7-Feb-08 19:10
bokuceres7-Feb-08 19:10 
GeneralGridView + .net 2.0 Pin
trilokharry5-Feb-08 2:46
trilokharry5-Feb-08 2:46 
GeneralRe: GridView + .net 2.0 Pin
Abhijit Jana5-Feb-08 2:51
professionalAbhijit Jana5-Feb-08 2:51 
GeneralRe: GridView + .net 2.0 Pin
bokuceres5-Feb-08 17:42
bokuceres5-Feb-08 17:42 
GeneralSql Connection Error!!! Pin
kibromg5-Feb-08 2:06
kibromg5-Feb-08 2:06 
GeneralRe: Sql Connection Error!!! Pin
Abhijit Jana5-Feb-08 2:25
professionalAbhijit Jana5-Feb-08 2:25 
GeneralRe: Sql Connection Error!!! Pin
kibromg5-Feb-08 2:47
kibromg5-Feb-08 2:47 
GeneralRe: Sql Connection Error!!! Pin
Abhijit Jana5-Feb-08 2:50
professionalAbhijit Jana5-Feb-08 2:50 
GeneralRe: Sql Connection Error!!! Pin
kibromg5-Feb-08 2:59
kibromg5-Feb-08 2:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.