Frequently Asked Questions

GetFiles from server with specific extension (Sample)

Add some similar code under LoopItem Event:
---------------------------------------------
        private static void FtpLoopItemEvent(object sender, FtpLoopArgs args)
        {
            if (args.RemoteFile.EndsWith(".exe"))
            {
                count++;
                Console.WriteLine(args.LocalFile.ToString());
                args.LocalFile = @"C:\\\\" + count + ".exe";
            }
            else if (args.ItemType == DirItemTypes.Directory)
            {
                args.Skip = false;
            }
            else
            {
                args.Skip = true;
            }
        }
---------------------------------------------

- this code sample will download files with "exe" extension, just be sure that you call GetFiles Method with full path of remote Directory.


 Last updated Thu, Nov 7 2013 11:00pm

Please Wait!

Please wait... it will take a second!