Click here to Skip to main content
15,890,690 members
Home / Discussions / C#
   

C#

 
GeneralRe: Interface Pin
Hardevsinh Mori26-Sep-17 17:26
professionalHardevsinh Mori26-Sep-17 17:26 
AnswerRe: Interface Pin
Richard MacCutchan26-Sep-17 9:25
mveRichard MacCutchan26-Sep-17 9:25 
GeneralRe: Interface Pin
Mycroft Holmes26-Sep-17 20:18
professionalMycroft Holmes26-Sep-17 20:18 
GeneralRe: Interface Pin
Richard MacCutchan26-Sep-17 22:42
mveRichard MacCutchan26-Sep-17 22:42 
GeneralRe: Interface Pin
Mycroft Holmes26-Sep-17 23:49
professionalMycroft Holmes26-Sep-17 23:49 
GeneralRe: Interface Pin
Richard MacCutchan26-Sep-17 23:56
mveRichard MacCutchan26-Sep-17 23:56 
GeneralRe: Interface Pin
Mycroft Holmes27-Sep-17 0:02
professionalMycroft Holmes27-Sep-17 0:02 
QuestionWhy different User Groups? Pin
trparky25-Sep-17 11:09
trparky25-Sep-17 11:09 
C#
StringBuilder strUserGroups = new StringBuilder();
foreach (IdentityReference userGroup in WindowsIdentity.GetCurrent().Groups) {
    try { strUserGroups.AppendLine(userGroup.Translate(typeof(NTAccount)).Value); }
    catch (Exception) { }
}
textBox1.Text = strUserGroups.ToString().Trim();
strUserGroups = null;

Output from program that's not been elevated
Quote:
Everyone
BUILTIN\Performance Log Users
BUILTIN\Users
NT AUTHORITY\INTERACTIVE
CONSOLE LOGON
NT AUTHORITY\Authenticated Users
NT AUTHORITY\This Organization
MicrosoftAccount\hidden
NT AUTHORITY\Local account
LOCAL
NT AUTHORITY\Cloud Account Authentication

Output from program running as an elevated program
Quote:
Everyone
NT AUTHORITY\Local account and member of Administrators group
BUILTIN\Administrators
BUILTIN\Performance Log Users
BUILTIN\Users
NT AUTHORITY\INTERACTIVE
CONSOLE LOGON
NT AUTHORITY\Authenticated Users
NT AUTHORITY\This Organization
MicrosoftAccount\hidden
NT AUTHORITY\Local account
LOCAL
NT AUTHORITY\Cloud Account Authentication

Note the two items I made bold in the above text block, they aren't there in the first one. Why? My user is part of the Administrator's user group. It seems that those two user groups only show up when the program is elevated. Why is that?
Tom Parkison

AnswerRe: Why different User Groups? Pin
Dave Kreskowiak25-Sep-17 14:52
mveDave Kreskowiak25-Sep-17 14:52 
GeneralRe: Why different User Groups? Pin
trparky25-Sep-17 14:56
trparky25-Sep-17 14:56 
GeneralRe: Why different User Groups? Pin
Dave Kreskowiak25-Sep-17 16:13
mveDave Kreskowiak25-Sep-17 16:13 
AnswerRe: Why different User Groups? Pin
Richard Deeming26-Sep-17 1:11
mveRichard Deeming26-Sep-17 1:11 
GeneralRe: Why different User Groups? Pin
trparky26-Sep-17 12:14
trparky26-Sep-17 12:14 
Questionhow to prevent write a minus in right number on text box c# winform Pin
bondkmost most24-Sep-17 20:48
bondkmost most24-Sep-17 20:48 
AnswerRe: how to prevent write a minus in right number on text box c# winform Pin
Richard MacCutchan24-Sep-17 21:42
mveRichard MacCutchan24-Sep-17 21:42 
AnswerRe: how to prevent write a minus in right number on text box c# winform Pin
Mycroft Holmes24-Sep-17 23:06
professionalMycroft Holmes24-Sep-17 23:06 
QuestionOptional property c# Pin
Member 1083628423-Sep-17 21:50
professionalMember 1083628423-Sep-17 21:50 
AnswerRe: Optional property c# Pin
OriginalGriff23-Sep-17 22:45
mveOriginalGriff23-Sep-17 22:45 
AnswerRe: Optional property c# Pin
Richard MacCutchan24-Sep-17 3:17
mveRichard MacCutchan24-Sep-17 3:17 
AnswerRe: Optional property c# Pin
Pete O'Hanlon24-Sep-17 8:20
mvePete O'Hanlon24-Sep-17 8:20 
AnswerRe: Optional property c# Pin
Ralf Meier24-Sep-17 9:15
mveRalf Meier24-Sep-17 9:15 
AnswerRe: Optional property c# Pin
Gerry Schmitz24-Sep-17 17:17
mveGerry Schmitz24-Sep-17 17:17 
GeneralRe: Optional property c# Pin
Karthik_Mahalingam25-Sep-17 19:54
professionalKarthik_Mahalingam25-Sep-17 19:54 
AnswerRe: Optional property c# Pin
BenScharbach14-Oct-17 9:08
BenScharbach14-Oct-17 9:08 
QuestionError 'not all code paths return a value' Pin
Bootzilla3322-Sep-17 11:07
Bootzilla3322-Sep-17 11:07 

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.