elena1234

CopyBinaryFile

Jan 17th, 2021 (edited)
278
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.45 KB | None | 0 0
  1. using System;
  2. using System.IO;
  3.  
  4. namespace CopyBinaryFile
  5. {
  6.     class Program
  7.     {
  8.         static void Main(string[] args)
  9.         {
  10.             using (FileStream reader = new FileStream(@"..\..\..\university.png", FileMode.Open, FileAccess.Read))
  11.             using (FileStream writer = new FileStream(@"..\..\..\newFile.png", FileMode.Create, FileAccess.Write))
  12.             {
  13.                 reader.CopyTo(writer);
  14.             }
  15.         }
  16.     }
  17. }
Add Comment
Please, Sign In to add comment