Advertisement
Sephinroth

prac 9 ex 2 final

Nov 30th, 2019
289
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.23 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.IO;
  6.  
  7. namespace ConsoleApplication2
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             using(StreamWriter tmp_file = new StreamWriter("e:/practice/tmp.txt", false))
  14.             {
  15.                 using(StreamReader first_file = new StreamReader("e:/practice/first.txt", Encoding.GetEncoding(1251)))
  16.                 {
  17.                     string i = first_file.ReadToEnd();
  18.                     tmp_file.Write(i);
  19.                 }
  20.             }
  21.             using(StreamWriter first_file = new StreamWriter("e:/practice/first.txt", false))
  22.             {
  23.                 using(StreamReader second_file = new StreamReader("e:/practice/second.txt", Encoding.GetEncoding(1251)))
  24.                 {
  25.                     string i = second_file.ReadToEnd();
  26.                     first_file.Write(i);
  27.                 }
  28.             }
  29.             using(StreamWriter second_file = new StreamWriter("e:/practice/second.txt", false))
  30.             {
  31.                 using(StreamReader tmp_file = new StreamReader("e:/practice/tmp.txt", Encoding.GetEncoding(1251)))
  32.                 {
  33.                     string i = tmp_file.ReadToEnd();
  34.                     second_file.Write(i);
  35.                 }
  36.             }
  37.            
  38.         }
  39.     }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement