Exemple #1
0
        static void Main(string[] args)
        {
            FileWriterWithProgress fileWriterWithProgress = new FileWriterWithProgress();

            fileWriterWithProgress.DataWriting     += FileWriterWithProgress_DataWriting;
            fileWriterWithProgress.DataWritingDone += FileWriterWithProgress_DataWritingDone;
            fileWriterWithProgress.WriteBytes(@"F:\testF.txt", GetDataByte(), 0.15f);
            Console.ReadLine();
        }
        static void Main(string[] args)
        {
            var filewriterwithprogress = new FileWriterWithProgress();

            filewriterwithprogress.WritingPerformed += Filewriterwithprogress_WritingPerformed;
            filewriterwithprogress.WritingCompleted += Filewriterwithprogress_WritingCompleted;
            var data = new byte[10];

            new Random().NextBytes(data);
            filewriterwithprogress.WriteBytes("File.txt", data, 0.1f);
            Console.ReadKey();
        }