🙂 İNSANLARIN EN HAYIRLISI INSANLARA FAYDALI OLANDIR 🙂

Ramazan HABER / C# Devexpress Athena / thread

 

1-) C# Devexpress Athena -  thread

private void athBtnIndir_Click(object sender, EventArgs e) {

            try {

                //System.Windows.Forms.Form.CheckForIllegalCrossThreadCalls= false;

                Thread thread1 = new Thread(() => MySetData());

                thread1.Start();

                Thread thread2 = new Thread(() => MyFileLoading());

                thread2.Start();

            } catch (Exception ex) {

                MessageBox.Show(ex.Message);

            }

        }

        public object locker = new object(); // bir işlem bitmeden diğerine geçmez3

        public static int LV_DataCount = 0;

        private void MySetData() {//ekrana yazar burada kaldım yeni ekranı tasarla skype gore oraya aktar

            lock (locker) {

                AthIO.MyFileDownload("", "", "http://www.athenaftp.com/sgkmes.zip", "D:\\deneme\\sgkmes.zip");

                AthIO.MyDeCompressFile("D:\\deneme\\sgkmes.zip", "D:\\deneme\\");

                DataTable W_data = AthExcelUtils.MyGetDataTableFromExcel("D:\\deneme\\SGKMESLEK_KODLARI_2016.xls", "RaporPrmMeslekKodu$");

                LV_DataCount = W_data.Rows.Count;

                gridControl1.DataSource = W_data;

            }

        }

        private void MyFileLoading() {//ekrana yazar burada kaldım yeni ekranı tasarla skype gore oraya aktar

            lock (locker) {

                progressBarControl1.Properties.Step = 1;

                progressBarControl1.Properties.PercentView = true;

                progressBarControl1.Properties.Maximum = LV_DataCount;

                progressBarControl1.Properties.Minimum = 0;

                for (int i = 0; i < LV_DataCount; i++) {

                    progressBarControl1.PerformStep();

                    progressBarControl1.Update();

                }

            }

        }

 2021 Ocak 18 Pazartesi
 493