本文介绍了启动Windows时自动运行软件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我想要一种方法,使我可以使用c#编写的程序在每次启动Windows时自动运行.
谢谢

Hi,
I want a method that enable me to make my program which is written in c# to run automatically in every time and when i starting windows.
thanks

推荐答案

using Microsoft.Win32;

// The path to the key where Windows looks for startup applications

RegistryKey yourApp = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true);

// Add the value in the registry so that the application runs at startup

yourApp.SetValue("MyApp", Application.ExecutablePath.ToString());



如果要停止应用程序自动启动,请



And if you want to stop your application to auto start then

yourApp.DeleteValue("MyApp", false);




这篇关于启动Windows时自动运行软件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 17:36
查看更多