the_alex_mark

Автозагрузка программы при старте Windows

Mar 24th, 2019
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.27 KB | None | 0 0
  1. using Microsoft.Win32;
  2.  
  3. RegistryKey registryKey = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true);
  4.  
  5. if (registryKey.GetValue("MyAppName") == null)
  6.     registryKey.SetValue("MyAppName", Application.ExecutablePath.ToString());
Add Comment
Please, Sign In to add comment