I need to upload files via FTP to my server, but this is not 1995, so I thought that I probably want to make it asynchronous or upload files in the background so as not to make the user interface unresponsive.
In the code, this page is a complete example of a synchronous method of uploading files via FTP. How can I turn this into an asynchronous method?
Synchronous Code:
using System; using System.IO; using System.Net; using System.Text; namespace Examples.System.Net { public class WebRequestGetExample { public static void Main () {
Should I just drop it at BackgroundWorker?
what should be noted:
I do not need to know the progress of the transfer / download. All I need to know is status (Download or Terminate).
source share