예제 #1
0
 public void Dispose()
 {
     if (impersonator != null)
     {
         impersonator.Dispose();
         impersonator = null;
     }
 }
예제 #2
0
 public void Dispose()
 {
     if (impersonator != null)
     {
         impersonator.Dispose();
         impersonator = null;
     }
 }
예제 #3
0
 public ImpersonationContext()
 {
     string username = Configuration.Services.NetworkImpersonation.Username;
     try
     {
         impersonator = new Impersonator(Configuration.Services.NetworkImpersonation.Domain, username, Configuration.Services.NetworkImpersonation.GetPassword());
     }
     catch (Exception e)
     {
         Log.Error(String.Format("Failed to impersonate {0}", username), e);
         impersonator = null;
     }
 }
예제 #4
0
        public ImpersonationContext()
        {
            string username = Configuration.Services.NetworkImpersonation.Username;

            try
            {
                impersonator = new Impersonator(Configuration.Services.NetworkImpersonation.Domain, username, Configuration.Services.NetworkImpersonation.GetPassword());
            }
            catch (Exception e)
            {
                Log.Error(String.Format("Failed to impersonate {0}", username), e);
                impersonator = null;
            }
        }