Пример #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;
            }
        }