End Google Ads 201810 - BS.net 01 --> Dear All,
I am uploading files to ftp server, which each file gets uploaded in a thread.
i am using the following code to upload files to ftp, upload and every thing is successfull, but my concern is the priority of uploading files.
in following code the file with the smallest size gets uploaded first, but i want that the first file should be uploaded before second and second before third and so on.
foreach (string str in filesToUpload)
{
if (str.EndsWith(".xml"))
ThreadPool.QueueUserWorkItem(new WaitCallback(uploadFile),(object)str);
}
I also used WaitHandles and AutoResetEvent, it did help but it stack my computer and also my UI.
so how can i wait one uploading before another gets uploaed or started?

Abdul Rahaman Hamidy
Database Developer
Kabul, Afghanistan