12345678910111213141516171819202122232425262728293031323334 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading;
- namespace Esercizio_file_tepi
- {
- class Program
- {
- static void Main(string[] args)
- {
- GestioneThread gt = new GestioneThread();
- Thread th1 = new Thread(new ThreadStart(gt.AddFile));
- th1.Name = "th1";
- th1.Start();
- Thread th2 = new Thread(new ThreadStart(gt.LeggereF));
- th2.Name = "th2";
- th2.Start();
- while ((th1.IsAlive) && (th2.IsAlive))
- {
- Thread.Sleep(10);
- }
- th1.Join();
- th2.Join();
- Console.ReadKey();
- }
- }
- }
|