I'm having a hard time understanding this.
I get what multithreading is- allowing a program to run more than one thread to improve performance, by splitting up some of it's resources.
So I'm at the point in my app where I need to use it. I need to upload some small text files in the background while the app is running and the user won't know their stuff is being backed up via FTP.
I don't understand where to put start- I have some code I found and a couple of good tutorials explaining the process- but...
Where do I put it? For example- I have a main form. I have a button that calls a class, and in the class is FTP code to upload some small text files. So what gets the separate thread? The class? The main form? I don't get it.
Here's some code- I don't think I have this right-
Private Sub btnUpload_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnUpload.Click
Dim load As New clsFTP
load.UploadLogsWithFTP()
Thread = New System.Threading.Thread(AddressOf load.UploadLogsWithFTP)
Thread.Start()
End Sub
Then more code in clsFTP (this isn't all the code)
Then I can't use Imports System.Threading in my main form 'cause it screws with my timers...
I dunno, I'm not getting this..