Я пишу простой ключ в реестре: < /p>
Код: Выделить всё
private bool autorunProperty;
private readonly static string registryString = "Software\\Microsoft\\Windows\\CurrentVersion\\Run";
private void CheckRegistryKey()
{
using (RegistryKey key = Registry.CurrentUser.OpenSubKey(registryString, true))
{
if (key != null)
{
object value = key.GetValue(appName);
if (value != null)
{
autorunProperty = true;
}
else
{
autorunProperty = false;
}
}
key.Close();
}
}
< /code>
Он работает отлично: чтение и написание в реестре.
Чтобы распределить его, я использовал «Упаковка MSIX для Visual Studio» и после тестовой установки, не пишу в реестре. Задача.
Microsoft представила « startuptsk < /strong>» класс, который будет использоваться в файле «package.appxmanifest».
с несколькими строками XML решается, как в примере: < /p>
https://nicksnettravels.builttoroam.com ... n-startup/
The management of the App is delegated to the specific section of the control panel: Apps > Стартап
Подробнее здесь: https://stackoverflow.com/questions/794 ... n-registry