当我们启动电脑时如何启动windows应用程序

发布于 2024-11-05 03:25:23 字数 61 浏览 1 评论 0原文

当我们启动计算机时如何启动Windows应用程序。在我的应用程序中,我想更新当前日期和时间。注册表中的时间。

How to start the windows application when we starts the computer. In my application I want to update the current date & time in registry.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

方觉久 2024-11-12 03:25:23

最简单的方法是将其添加到“启动”文件夹中,您可以在其中找到 Windows 按钮 ->所有节目。
如果您有本地化的 Windows 版本,它的名称可能会有所不同。

The easiest way is to add it to the "startup" folder which you can find the Windows button -> All programs.
It might be named differently if you have a localized Windows version.

月依秋水 2024-11-12 03:25:23

使用注册表中的“运行”键。

请参阅http://support.microsoft.com/kb/314866

Use the "Run" key in the registry.

See http://support.microsoft.com/kb/314866

深海蓝天 2024-11-12 03:25:23

您可以使用Startup文件夹,如果您的用户不再需要它,他们可以轻松处理。

然后注册表中有Run键,请参阅安德鲁的回答。

此外,您还可以设置一个 Windows 服务,该服务不以交互方式执行操作,并且在没有用户登录时执行操作。该服务可以执行单一操作,自动启动并在完成工作后终止(它不需要像大多数服务一样循环) 。

You can use the Startup folder, thats easy to handle by your users if they do not want it anymore.

Then there ist the Run key in the registry, see Andrew' answer.

Also you might set up a windows service which does things not interactivly and also when no user is logged in. This service can do a single thing, start up automatic und terminate after finishing its work (it does not need to loop like most services).

萌能量女王 2024-11-12 03:25:23

您可以使用两种简单的方法来执行此操作。

添加到启动文件夹

Environment.GetFolderPath(Environment.SpecialFolder.Startup) 

添加注册表项

RegistryKey myKey= Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true);    
myKey.SetValue("Your Application Name", "\"" + Application.ExecutablePath.ToString() + "\); 

You can use two easy ways to do this.

Add to Start up folder

Environment.GetFolderPath(Environment.SpecialFolder.Startup) 

Add registry entry

RegistryKey myKey= Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true);    
myKey.SetValue("Your Application Name", "\"" + Application.ExecutablePath.ToString() + "\); 
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文