threading problem

Oct 31 2008 11:07 AM
Hi; I have a form that havemany processes..When my application start form freeze and only textbox,progress working...My total progress lasts up to 30 mins so i wanna put a pause button to it..My code is below.. Regards.. private void button2_Click(object sender, EventArgs e) { progressBar1.PerformStep(); int iterativer = 0; try { listBox1.Items.Insert(0, "AlexaRank Bulunuyor..."); listBox1.Update(); AlexaRank ar = new AlexaRank(); Alexa_Rank = ar.AlexaRankGoster(Form1.url.ToString()); my_Perform_Stepper(2); listBox1.Items.Insert(0, "Site Uzantisi Analizi Yapiliyor..."); listBox1.Update(); AlanAdiUzantisi aau = new AlanAdiUzantisi(); url_uzanti = aau.AlanAdi(Form1.url.ToString()); my_Perform_Stepper(1); listBox1.Items.Insert(0, "Analitik Yazilimlar Inceleniyor..."); listBox1.Update(); AnalyticsVarMI anv = new AnalyticsVarMI(); analitik = anv.IfAnalytics(Form1.url.ToString()); my_Perform_Stepper(2); listBox1.Items.Insert(0, "Google Backlink Sayisi Ölçülüyor..."); listBox1.Update(); GoogleBackLinkSayisi gbl = new GoogleBackLinkSayisi(); google_bl = (double)gbl.GoogleBacklink(Form1.url.ToString()); my_Perform_Stepper(3); listBox1.Items.Insert(0, "Css Derlemesi Yapiliyor..."); listBox1.Update(); CssCompiler cc = new CssCompiler(); css_compile = cc.CssCompileJob(Form1.url.ToString()); my_Perform_Stepper(5); listBox1.Items.Insert(0, "DMOZ dizinine bakiliyor..."); listBox1.Update(); DMOZCheck dc = new DMOZCheck(); dmoz_check = dc.DMOZChecker(Form1.url.ToString()); my_Perform_Stepper(3); listBox1.Items.Insert(0, "Site yasina bakiliyor..."); listBox1.Update(); DomainAge da = new DomainAge(); domain_age = da.DomainAger(Form1.url.ToString()); my_Perform_Stepper(3); listBox1.Items.Insert(0, "PageRank degerinize bakiliyor..."); listBox1.Update(); GooglePageRank gpr = new GooglePageRank(); pr = gpr.GooglePageRangGoster(Form1.url.ToString()); my_Perform_Stepper(3); //for (iterativer = 0; iterativer < AnahtarKelimeBelirle.analiz_keyword.Count; iterativer++) //{ // listBox1.Items.Add("Google daki pozisyonlariniza bakiliyor..."); // listBox1.Update(); // GoogleSearchPosition gsp = new GoogleSearchPosition(); // google_pos.Add(gsp.GetPosition(Form1.url.ToString(), AnahtarKelimeBelirle.analiz_keyword[iterativer])); //} listBox1.Items.Insert(0, "HTML derleme yapiliyor..."); listBox1.Update(); HtmlCompiler htmlc = new HtmlCompiler(); html_compile = htmlc.HtmlCompileJob(Form1.url.ToString()); my_Perform_Stepper(5); listBox1.Items.Insert(0, "Yahoo dizinine bakiliyor..."); listBox1.Update(); IsYahooDirectory isy = new IsYahooDirectory(); yahoo_dir = isy.ControlYahoo(Form1.url.ToString()); my_Perform_Stepper(2); listBox1.Items.Insert(0, "Sitenizdeki linkler sayiliyor..."); listBox1.Update(); LinkCount lc = new LinkCount(); link_count = lc.LinkCounter(Form1.url.ToString()); my_Perform_Stepper(2); . . . . . . . . I tried to stop these code brackets when pushed to pasue button..I think possible solution is threading..how can i use threading in these code..

Answers (2)