示例#1
0
 public static void Test()
 {
     BackGroundworkerForm f = new BackGroundworkerForm();
     Console.WriteLine("Press any key to Start");
     Console.ReadKey(true);
     f.Start();
     Thread.Sleep(5000);
     Console.WriteLine("Press any key to Stop");
     Console.ReadKey(true);
     f.Cancel();
     Console.WriteLine("Press any key to Exit");
     Console.ReadKey(true);
 }
示例#2
0
        public static void Test()
        {
            BackGroundworkerForm f = new BackGroundworkerForm();

            Console.WriteLine("Press any key to Start");
            Console.ReadKey(true);
            f.Start();
            Thread.Sleep(5000);
            Console.WriteLine("Press any key to Stop");
            Console.ReadKey(true);
            f.Cancel();
            Console.WriteLine("Press any key to Exit");
            Console.ReadKey(true);
        }