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

C#

 
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 
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 
You might be able to test for this using the "deny only SID" claim:
C#
public static bool IsAdministrator(this WindowsIdentity identity)
{
    if (identity == null) throw new ArgumentNullException(nameof(identity));
    
    WindowsPrincipal principal = new WindowsPrincipal(identity);
    if (principal.IsInRole(WindowsBuiltInRole.Administrator)) return true; // Elevated
    
    return identity.FindAll(ClaimTypes.DenyOnlySid).Any(c => c.Value == "S-1-5-114");
}

S-1-5-114
Local account and member of Administrators group
You can use this SID when restricting network logon to local accounts instead of "administrator" or equivalent. This SID can be effective in blocking network logon for local users and groups by account type regardless of what they are actually named.




"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer


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 
AnswerRe: Error 'not all code paths return a value' Pin
Pete O'Hanlon22-Sep-17 12:08
mvePete O'Hanlon22-Sep-17 12:08 
GeneralRe: Error 'not all code paths return a value' Pin
BenScharbach14-Oct-17 9:11
BenScharbach14-Oct-17 9:11 
AnswerRe: Error 'not all code paths return a value' Pin
Karthik_Mahalingam25-Sep-17 19:55
professionalKarthik_Mahalingam25-Sep-17 19:55 
SuggestionRe: Error 'not all code paths return a value' Pin
Richard Deeming26-Sep-17 0:55
mveRichard Deeming26-Sep-17 0:55 

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.