Advertisement
Guest User

Untitled

a guest
Oct 15th, 2019
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.IO;
  7.  
  8. namespace chg
  9. {
  10. class Program
  11. {
  12. static void Main(string[] args)
  13. {
  14. Console.WriteLine("Add meg a dátumot, órát percet amire módosítani szeretnéd a mentési dátumot, és a fájl nevét");
  15. Console.WriteLine();
  16. Console.WriteLine();
  17.  
  18. Random sec = new Random();
  19.  
  20. Console.Write("év: ");
  21. int year = Convert.ToInt32(Console.ReadLine());
  22. Console.Write("hónap: ");
  23. int month = Convert.ToInt32(Console.ReadLine());
  24. Console.Write("nap: ");
  25. int day = Convert.ToInt32(Console.ReadLine());
  26. Console.Write("óra: ");
  27. int hour = Convert.ToInt32(Console.ReadLine());
  28. Console.Write("perc: ");
  29. int min = Convert.ToInt32(Console.ReadLine());
  30. Console.Write("fájlnév: ");
  31. string name = Console.ReadLine();
  32.  
  33.  
  34. var hm = new DateTime(year, month, day, hour, min, sec.Next(0, 60));
  35.  
  36. File.SetLastWriteTime(name, hm);
  37.  
  38. }
  39. }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement