© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
1 reply
boydiscover

❔ Need help adding a progress bar to an rclone downloader

Hello everybody, I have a game downloader using rclone and I need help adding a progress bar, ive tried many ways but theyve all failed and im probably doing something wrong. Here is a part of the code

public async Task DownloadGame(string game, string downloadpath)
       {
            Process process = new Process();
            process.StartInfo.FileName = rclonepath;
            process.StartInfo.UseShellExecute = false;
            process.StartInfo.RedirectStandardOutput = true;
            process.StartInfo.RedirectStandardError = false;
            process.StartInfo.CreateNoWindow = true;
            process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
            process.StartInfo.Arguments = "copy -P " + "test1:" + game + " " + downloadpath + game;
            process.EnableRaisingEvents = true;



            process.Start();

            process.BeginOutputReadLine();

            // Wait for the process to exit
            await Task.Run(() => process.WaitForExit());
        }
        private void guna2Button1_Click(object sender, EventArgs e)
        {
            string game = "mygame";
            string downloadpath = "C:\\temp\\";

            DownloadGame(game, downloadpath);
        }
    }
}
public async Task DownloadGame(string game, string downloadpath)
       {
            Process process = new Process();
            process.StartInfo.FileName = rclonepath;
            process.StartInfo.UseShellExecute = false;
            process.StartInfo.RedirectStandardOutput = true;
            process.StartInfo.RedirectStandardError = false;
            process.StartInfo.CreateNoWindow = true;
            process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
            process.StartInfo.Arguments = "copy -P " + "test1:" + game + " " + downloadpath + game;
            process.EnableRaisingEvents = true;



            process.Start();

            process.BeginOutputReadLine();

            // Wait for the process to exit
            await Task.Run(() => process.WaitForExit());
        }
        private void guna2Button1_Click(object sender, EventArgs e)
        {
            string game = "mygame";
            string downloadpath = "C:\\temp\\";

            DownloadGame(game, downloadpath);
        }
    }
}


As you can see, the rclone download part is a function and can be called from a button click, this is to make it easier as I am using many buttons.

One way im thinking on how to do this is by getting the progress from rclone itself and sending that to the program and then using the percentage in a progress bar, but im having no luck

Heres the output of a rclone copy
Transferred:       53.683M / 2.346 GBytes, 2%, 10.732 MBytes/s, ETA 3m38s
Transferred:            0 / 1, 0%
Elapsed time:         6.5s
Transferring:
Transferred:       53.683M / 2.346 GBytes, 2%, 10.732 MBytes/s, ETA 3m38s
Transferred:            0 / 1, 0%
Elapsed time:         6.5s
Transferring:
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

Progress bar and an TFTP library
C#CC# / help
3y ago
Progress bar problem
C#CC# / help
2y ago
✅ How to make a "loading" progress bar
C#CC# / help
2y ago
❔ So I've created a downloader, how do I link a progress bar to it? Winform, .NET framework
C#CC# / help
3y ago