DyNaMiXx7

Untitled

Nov 1st, 2018
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.56 KB | None | 0 0
  1. using System;
  2. using System.IO;
  3. using System.Text;
  4.  
  5. namespace WriteInFile
  6. {
  7.     class Program
  8.     {
  9.         static void Main(string[] args)
  10.         {
  11.             var f = File.Open("storage.txt", FileMode.Create);
  12.             var rng = new Random();
  13.             for (int i = 0; i < 100_000; ++i)
  14.             {
  15.                 string line = rng.Next() + Environment.NewLine;
  16.                 byte[] lineBytes = Encoding.UTF8.GetBytes(line);
  17.                 f.Write(lineBytes, 0, lineBytes.Length);
  18.             }
  19.             f.Close();
  20.         }
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment