mattnguyen

Untitled

Mar 27th, 2021
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. using System;
  2. using System.IO;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace DemoApplication
  7. {
  8. class Tutorial
  9. {
  10. static void Main(string[] args)
  11. {
  12. String path = @"C:\Users\hp\Desktop\test\TemenuzhkaGrozdanova_18114177.txt";
  13.  
  14. using (StreamWriter sr = File.AppendText(path))
  15. {
  16. sr.WriteLine(DateTime dtToday = DateTime.Now;
  17. dtToday.ToString(" dd MMMM yyyy HH:mm:ss"));
  18. sr.WriteLine(Console.WriteLine($"Value {0} \n Currency {1} \n Date and time {2}", dtToday));
  19. sr.Close();
  20.  
  21. Console.WriteLine(File.ReadAllText(path));
  22. }
  23. Console.ReadKey();
  24. }
  25. }
  26. }
  27.  
Advertisement
Add Comment
Please, Sign In to add comment