Click here to Skip to main content
16,004,977 members
Home / Discussions / C#
   

C#

 
GeneralRe: C# Question time! Pin
harold aptroot19-May-09 5:16
harold aptroot19-May-09 5:16 
GeneralRe: C# Question time! Pin
molesworth19-May-09 5:36
molesworth19-May-09 5:36 
AnswerRe: C# Question time! Pin
musefan19-May-09 3:54
musefan19-May-09 3:54 
GeneralRe: C# Question time! Pin
Matt Cavanagh19-May-09 11:44
Matt Cavanagh19-May-09 11:44 
AnswerRe: C# Question time! Pin
PIEBALDconsult19-May-09 4:10
mvePIEBALDconsult19-May-09 4:10 
AnswerRe: C# Question time! Pin
harold aptroot19-May-09 4:33
harold aptroot19-May-09 4:33 
QuestionChecking if app is running under a Admin account in XP Pin
Brad Wick19-May-09 3:20
Brad Wick19-May-09 3:20 
AnswerRe: Checking if app is running under a Admin account in XP Pin
Luc Pattyn19-May-09 4:57
sitebuilderLuc Pattyn19-May-09 4:57 
Hi,

this is a snippet I once used, it shows "User" or "User, Administrator" IIRC:
List<string> roles=new List<string>();
try {
    //  on LP9300 this code produces an exception "Unable to get role for this RID"
    Thread.GetDomain().SetPrincipalPolicy(PrincipalPolicy.WindowsPrincipal);
    WindowsPrincipal wp=new WindowsPrincipal(WindowsIdentity.GetCurrent());
    foreach(object roleName in Enum.GetValues(typeof(WindowsBuiltInRole)))
        if (wp.IsInRole((WindowsBuiltInRole)roleName)) roles.Add(roleName.ToString());
} catch (Exception exc) {
    log(exc);
}
log("Windows role = "+string.Join(", ", roles.ToArray()));


Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.

QuestionProblem with SetupProject Pin
maf66619-May-09 3:09
maf66619-May-09 3:09 
QuestionRe: Problem with SetupProject Pin
maf66619-May-09 22:17
maf66619-May-09 22:17 
QuestionRe: Problem with SetupProject Pin
maf66624-May-09 7:08
maf66624-May-09 7:08 
QuestionStatic class info across multiple application instances? Pin
Jacobus0119-May-09 2:25
Jacobus0119-May-09 2:25 
AnswerRe: Static class info across multiple application instances? Pin
Luc Pattyn19-May-09 2:35
sitebuilderLuc Pattyn19-May-09 2:35 
GeneralRe: Static class info across multiple application instances? Pin
Jacobus0119-May-09 2:47
Jacobus0119-May-09 2:47 
GeneralRe: Static class info across multiple application instances? Pin
Luc Pattyn19-May-09 2:54
sitebuilderLuc Pattyn19-May-09 2:54 
GeneralRe: Static class info across multiple application instances? Pin
Jacobus0119-May-09 2:59
Jacobus0119-May-09 2:59 
GeneralRe: Static class info across multiple application instances? Pin
ely_bob19-May-09 17:04
professionalely_bob19-May-09 17:04 
GeneralRe: Static class info across multiple application instances? Pin
Luc Pattyn19-May-09 17:09
sitebuilderLuc Pattyn19-May-09 17:09 
AnswerRe: Static class info across multiple application instances? Pin
S. Senthil Kumar19-May-09 3:30
S. Senthil Kumar19-May-09 3:30 
QuestionC# creating custom style combo box Pin
precious roy19-May-09 1:27
precious roy19-May-09 1:27 
GeneralRe: C# creating custom style combo box Pin
OriginalGriff19-May-09 1:56
mveOriginalGriff19-May-09 1:56 
GeneralRe: C# creating custom style combo box Pin
precious roy19-May-09 2:35
precious roy19-May-09 2:35 
GeneralRe: C# creating custom style combo box Pin
stancrm19-May-09 3:08
stancrm19-May-09 3:08 
GeneralRe: C# creating custom style combo box Pin
precious roy19-May-09 3:14
precious roy19-May-09 3:14 
QuestionEvent Handlers Pin
Silvyster19-May-09 0:30
Silvyster19-May-09 0:30 

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.