1
Answer

Pausing current executiong with button(possibly threading)

Photo of batuhan gundogdu

batuhan gundogdu

16y
3.2k
1
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..

Answers (1)

0
Photo of Karthik Kumar
NA 182 23.1k 9y
yes.i am using windows 8 and  VS 2013 updated this code working in windows phone8.0 but not in 8.1
0
Photo of Afzaal Ahmad Zeeshan
NA 36k 2m 9y
Perhaps that assembly is not found, are you sure the framework is installed correctly? The problem would be caused if the framework is not installed properly, or if you are trying to install the application compiled for a latest release on a previous system.