Topic "SessionFileTransferProgress - show filename/progress on form"

Author Message
Guest




I used the C# example for automating file transfer with FileTransferProgress. The SFTP transfer itself works fine. I changed the Console output to go to the Debug window, but I need to display the information to a user in a nice format.

How can I get the filename and progress value to display on a C# form?

I am new to C#. Any help is much appreciated. Thanks

Code:

        private static void SessionFileTransferProgress(object sender, FileTransferProgressEventArgs e)
        {
            // New line for every new file
            if ((_lastFileName != null) && (_lastFileName != e.FileName))
            {
                System.Diagnostics.Debug.WriteLine("~~~~~~");
            }

            // Print transfer progress
            System.Diagnostics.Debug.WriteLine("\r{0} ({1:P0})", e.FileName, e.FileProgress);

            // Remember a name of the last file reported
            _lastFileName = e.FileName;
            _lastFileProgress = e.FileProgress
        }
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24991
Location: Prague, Czechia
I'm sorry, but your question is out of scope of this forum.
_________________
Martin Prikryl
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License