[MonoDevelop] Threading issues
Neil Munro
neilmunro at gmail.com
Fri Feb 23 17:47:14 EST 2007
Hi, I posted here a while back about a progress bar issue I had, to be told
I needed to learn about threading to make it work, I am learning from Mono:
Kick start and Mono: A Developers guide and both have a bit about threading
but I still cannot seem to get it right. It is still regarding how to get a
progress bar to work but I seem to have trouble with threads any help would
be appreciated.
This is the code i have written so far
Thread thread;
ThreadStart download = new ThreadStart ( vDownload );
thread = new Thread ( download );
thread.Start ( );
ThreadStart apb = new ThreadStart ( AdjustProgressBar1 );
thread = new Thread ( apb );
thread.Start ( );
protected void AdjustProgressBar1 ( )
{
PBStatus.Fraction = 0.20;
}
protected virtual void vDownload()
{
try
{
StreamWriter GenerateScript = new StreamWriter ( "download.sh"
);
GenerateScript.WriteLine ( "#!/bin/bash" );
GenerateScript.WriteLine ( "mkdir temp" );
GenerateScript.WriteLine ( "cd temp" );
GenerateScript.WriteLine ( "wget {0}", ENURL.Text );
GenerateScript.Close ( );
ProcessStartInfo ExeScript = new ProcessStartInfo ( );
ExeScript.FileName = "chmod";
ExeScript.Arguments = "+x download.sh";
Process process = Process.Start ( ExeScript );
process.WaitForExit ( );
process.Close ( );
ProcessStartInfo RunScript = new ProcessStartInfo ( );
RunScript.FileName = "sh";
RunScript.Arguments = "download.sh";
Process process2 = Process.Start ( RunScript );
process2.WaitForExit ( );
process2.Close ( );
}
catch (Exception ex)
{
ENInfo.Text = ex.Message;
}
/*finally
{
PBStatus.Fraction = 0.20;
}*/
}
Neil Munro
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/monodevelop-list/attachments/20070223/cb769fe0/attachment.html
More information about the Monodevelop-list
mailing list