Exemple #1
0
        static void Main()
        {
            Threads ParallelThread = new Threads();
            DBAcces DataBase       = new DBAcces();

            DataBase.myConnection = new System.Data.OleDb.OleDbConnection(DataBase.connectString);
            DataBase.myConnection.Open();
            // ParallelThread.DataBase = DataBase;
            Thread parallelThread = new Thread(new ParameterizedThreadStart(Threads.ParallelFunction));

            parallelThread.Start(DataBase);


            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1(DataBase, parallelThread));
        }
Exemple #2
0
        public static void ParallelFunction(object obj)
        {
            DBAcces DataBase = (DBAcces)obj;

            while (true)
            {
                DataBase.UpdateTime();

                OleDbDataReader URLToCheck = DataBase.GetSitesReadyToCheck();

                while (URLToCheck.Read())
                {
                    string URL = URLToCheck[0].ToString();

                    DataBase.UpdateDataAboutWorking(CheckIfWorking(URL), URL);
                }
                URLToCheck.Close();
                DataBase.RefreshTime();

                Thread.Sleep(1000);
            }
        }
Exemple #3
0
 public Form1(DBAcces Base, Thread thread)
 {
     InitializeComponent();
     DateBase     = Base;
     secondthread = thread;
 }