Subject: System.InvalidOperationException on SCP Download Skip
Date: 2021-03-29 14:51:29
From: Bodo
Source: system-invalidoperationexception-scp-download-skip
----------------------------------------------------------------------

Hi,

We use you ComponentPro.Net.Scp control to download directories/files. We would like to ignore some type of files.

But when I use the 'Skip' flag in ComponentPro.IO.FileSystemProgressEventArgs to step over an specific download, I get an System.InvalidOperationException.

What is the right way to achive our goal with the scp control?

Thanks, Bodo

Code to reproduce this issue:

    public void SkipTest()
    {
     using(Scp Client = new Scp())
     {
      Client.Progress  = Client_Progress;
    
      Client.Connect("Server");
      Client.Authenticate(...);
      Client.Download("DatDir/SubDir", @"d:\tmp"); //fires System.InvalidOperationException
      Client.Disconnect();
     }
    }
    
    private void Client_Progress(object sender, ComponentPro.IO.FileSystemProgressEventArgs e)
     {
       if(e.State == TransferState.StartDownloadingFile)
       {
         if(e.SourcePath.EndsWith(".tmp"))
                e.Skip = true;
       }
     }

----------------------------------------------------------------------

Note: This question has been asked on the Q&A forum of Thang Dang's fraudulent ComponentPro brand
If you purchased anything from ComponentPro, you have been scammed. Contact the payment processor
who sold you the license and ask for your money back.

Back to ComponentPro Q&A Forum Index