у меня возник вопрос, можно ли как-нибудь сделать автозагрузку через планировщик задач, а то через regedit не получается, выбивает следующую ошибку: Thread restrictions: The topic author allowed to post messages in the topic only to the following groups (and higher ranked): Resident, Staff Members and Curators
Причём тут RegEdit если у тебя не импортировано пространство имён System.Windows.Forms? Вместо Application попробуй использовать Assembly из пространства имён System.Reflection (насчёт детектов не в курсе, может поднять слышал) Автозагрузку через планировщик сделать можно, при помощи командной строки.
wDude, using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Text.RegularExpressions; using System.Threading; using Microsoft.Win32; using System.IO; using System.Windows.Forms; using static System.Net.Mime.MediaTypeNames; namespace svсhost { internal class Program { static RegistryKey onStartup = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true); public static void SetOnStartup(bool run) { if (run == true) rkApp.SetValue("MyApplication", Application.ExecutablePath.ToString()); else rkApp.DeleteValue("MyApplication", false); } C# using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Text.RegularExpressions; using System.Threading; using Microsoft.Win32; using System.IO; using System.Windows.Forms; using static System.Net.Mime.MediaTypeNames; namespace svсhost { internal class Program { static RegistryKey onStartup = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true); public static void SetOnStartup(bool run) { if (run == true) rkApp.SetValue("MyApplication", Application.ExecutablePath.ToString()); else rkApp.DeleteValue("MyApplication", false); } И что здесь не так?