I need some help how to get around this. I made an app that cycles through a bunch of files and uploads videos to youtube and images to my server. I have it coded so it shows an animated gif and a label that tells what file it's working on at the time. Then it does the upload to youtube then the upoad to my server.
The second you click the button to start the process, the app shows "not responding". It's doing the upload as I can tell from the network activity, but it didn't show the animated gif nor did it update the label. So it's like it hit the youtube upload part so fast it went into not responding before it even showed those 2 items. Users will be uploading over 50 videos at a time, is there a way to not have it do the not responding thing? And how can I get it to run the code to show the label and the gif? Some kind of sleep timer?
Help would appreciated.
Kirtan PatelPosted May 18, 2009, 11:04 PM
Try to run Exe Directly from /Bin/Debug
it Will not Happen to you
t1.Abort();
Thread.Sleep(500);
MessageBox.Show("Process Complete!!");
Lisa MPosted May 18, 2009, 8:18 PM
Perfect!
One final question. After t1.Abort I show a MessageBox that says the operation is complete. The MessageBox shows up underneath the dialog box opened up in t1. I tried putting a sleep after the t1.Abort statement but that didn't do anything. Any thoughts on that?
Kirtan PatelPosted May 18, 2009, 4:32 PM
Declare Thread t1 as Global
Thread t1;
public void ShowProcess()
{
ProgressForm p = new ProgressForm();
p.ShowDialog();
}
private void btnUploadData_Click(object sender, EventArgs e)
{
//Start ProcessForm Window
t1 = new Thread(ShowProcess);
if (t1.IsAlive == false)
{
t1 = new Thread(ShowProcess);
t1.Start();
}
//Do Some Process
//When Process Completed
t1.Abort();
}
Lisa MPosted May 18, 2009, 1:32 PM
Lisa MPosted May 18, 2009, 1:21 PM
Kirtan PatelPosted May 16, 2009, 4:44 PM
That Will Show One Other Form Having Progress bar With Marquee animation and start that Thread When you Click The Button and Uploading Process start
this Will Show Progress bar form that will indicate user that Process is Running
and when Uploading is Finished Terminate/Abort the Created Thread so Progress bar form will be Closed