Пример #1
0
 public void RemoveCredentials(BitsCredentials credentials)
 {
     try
     {
         if (job2 != null && credentials != null) // only supported from IBackgroundCopyJob2 and above
         {
             job2.RemoveCredentials((BG_AUTH_TARGET)credentials.AuthenticationTarget, (BG_AUTH_SCHEME)credentials.AuthenticationScheme);
         }
         else
         {
             throw new NotSupportedException("IBackgroundCopyJob2");
         }
     }
     catch (COMException exception)
     {
         manager.PublishException(this, exception);
     }
 }
Пример #2
0
 public void AddCredentials(BitsCredentials credentials)
 {
     try
     {
         if (job2 != null && credentials != null)   // only supported from IBackgroundCopyJob2 and above
         {
             BG_AUTH_CREDENTIALS bgCredentials = new BG_AUTH_CREDENTIALS();
             bgCredentials.Scheme = (BG_AUTH_SCHEME)credentials.AuthenticationScheme;
             bgCredentials.Target = (BG_AUTH_TARGET)credentials.AuthenticationTarget;
             bgCredentials.Credentials.Basic.Password = credentials.Password.ToString();
             bgCredentials.Credentials.Basic.UserName = credentials.UserName.ToString();
             job2.SetCredentials(ref bgCredentials);
         }
         else
         {
             throw new NotSupportedException("IBackgroundCopyJob2");
         }
     }
     catch (COMException exception)
     {
         manager.PublishException(this, exception);
     }
 }
Пример #3
0
 public void RemoveCredentials(BitsCredentials credentials)
 {
     try
     {
         if (job2 != null && credentials != null) // only supported from IBackgroundCopyJob2 and above
         {
             job2.RemoveCredentials((BG_AUTH_TARGET)credentials.AuthenticationTarget, (BG_AUTH_SCHEME)credentials.AuthenticationScheme);
         }
     }
     catch (COMException exception)
     {
         manager.PublishException(this, exception);
     }
 }
Пример #4
0
 public void AddCredentials(BitsCredentials credentials)
 {
     try
     {
         if (job2 != null && credentials != null)   // only supported from IBackgroundCopyJob2 and above
         {
             BG_AUTH_CREDENTIALS bgCredentials = new BG_AUTH_CREDENTIALS();
             bgCredentials.Scheme = (BG_AUTH_SCHEME)credentials.AuthenticationScheme;
             bgCredentials.Target = (BG_AUTH_TARGET)credentials.AuthenticationTarget;
             bgCredentials.Credentials.Basic.Password = credentials.Password.ToString();
             bgCredentials.Credentials.Basic.UserName = credentials.UserName.ToString();
             job2.SetCredentials(ref bgCredentials);
         }
     }
     catch (COMException exception)
     {
         manager.PublishException(this, exception);
     }
 }