示例#1
0
        static void Main(string[] args)
        {
            var writer = new FileWriterWithProgress();

            writer.WritingPerformed += OnWritingPerformed;
            writer.WritingCompleted += OnWritingCompleted;
            var info = new byte[10000];

            new Random().NextBytes(info);
            writer.WriteBytes("file1.txt", info, 0.07f);
        }
示例#2
0
        static void Main(string[] args)
        {
            var fileWriter = new FileWriterWithProgress();

            fileWriter.WritePerformed += ActionsEvent;
            fileWriter.WriteCompleted += EndEvent;
            var random = new Random();
            var array  = new byte[100];

            random.NextBytes(array);
            fileWriter.WriteBytes("FileByteLog.txt", array, 0.1f);
        }
示例#3
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);
        }