예제 #1
0
 public static T InvokeWithCredential <T>([NotNull] this ServiceController thisValue, [NotNull] Func <ServiceController, T> action, [NotNull] NetworkCredential credential)
 {
     return(ImpersonationHelper.RunWithCredential(credential, LogonType.Interactive, () => action(thisValue)));
 }
예제 #2
0
 public static void InvokeWithCredential([NotNull] this ServiceController thisValue, [NotNull] Action <ServiceController> action, [NotNull] NetworkCredential credential)
 {
     ImpersonationHelper.RunWithCredential(credential, LogonType.Interactive, () => action(thisValue));
 }