Пример #1
0
        static void Main()
        {
            Console.WriteLine("путь");
            var filename = @"f:\c#\log.log";

            var writer = new FileWriterWithProgress(filename);

            writer.WritingPerformed += Writer_WritingPerformed;
            writer.WritingCompleted += Writer_WritingCompleted;
            writer.WriteBytes(filename, new byte[10], 0.2f);
            Console.ReadKey();
        }
Пример #2
0
        static void Main(string[] args)
        {
            var fileWriter = new FileWriterWithProgress();
            var write      = new Result();

            byte[] data   = new byte[10000];
            var    random = new Random();

            for (int i = 0; i < data.Length; i++)
            {
                data[i] = (byte)random.Next(255);
            }

            fileWriter.WritingPerformed += write.WriteResultData;
            fileWriter.WritingCompleted += write.WriteResultFinished;
            fileWriter.WriteBytes($"log.txt", data, 0.1f);
        }