Abdula_2314124

Untitled

Mar 19th, 2024
749
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.50 KB | Source Code | 0 0
  1. using System;
  2. using System.IO;
  3.  
  4. namespace Files
  5. {
  6.     class Program
  7.     {
  8.         static void Main(string[] args)
  9.         {
  10.             string nameFile = "Test.txt";
  11.             if (!File.Exists(nameFile))
  12.             {
  13.                 File.Create(nameFile);
  14.             }
  15.  
  16.             //File.WriteAllText(nameFile, "Write");
  17.             File.AppendAllText(nameFile, "BomBom");
  18.             Console.WriteLine(File.ReadAllText(nameFile));
  19.  
  20.             Console.ReadLine();
  21.         }
  22.     }
  23. }
  24.  
Advertisement
Add Comment
Please, Sign In to add comment