Ejemplo n.º 1
0
 public static void CopyTo(this FileInfo file, string computerName, string userName, string password, string remotePath = null)
 {
     using (RunAsContext runasContext = RunAs.Impersonate(userName, password))
     {
         CopyTo(file, computerName, remotePath);
     }
 }
Ejemplo n.º 2
0
 public void Dispose()
 {
     RunAs.UndoImpersonate(this);
     if (Context != null)
     {
         Context.Dispose();
     }
 }