想要使vb.net应用程序在部署时在启动时运行 [英] Want to make vb.net application run at startup when deployed
问题描述
你好,
我创建了一个vb.net应用程序,该应用程序必须在启动应用程序(即部署了安装程序)后启动Windows时自动运行,并且必须在应用程序退出后关闭计算机.
我对制作这些程序感到困惑.我不知道如何使用REGISTRY ...
这意味着我要使用数据值进入注册表必须是应用程序exe路径,即该路径必须是安装了应用程序的应用程序文件夹.
因此,我需要帮助...谢谢.
Hello,
I have created an vb.net application which must run automatically when windows start after application has been launched(ie. setup has been deployed) and the machine must turn off after the appliaction has exited.
I am confused to make these programe.ie.i dont know how to use REGISTRY...
Thant means I want make entry into registry with data value must be the application exe path ie.the path must be the application folder wherever the application is installed.
So please I need a help...Thanks.
推荐答案
[运行和RunOnce注册表项" [ ^ ].
使用vb.net关闭系统" [ ^ ].
"Working with Windows Registry using VB.NET"[^], "Run and RunOnce Registry Keys"[^].
"system shutdown with vb.net"[^].
你好
请参阅注册表示例 http://www.codeproject.com/KB/vb/registry_with_vb.aspx
在窗口启动时运行应用程序
示例代码.
Hello
See Registry example http://www.codeproject.com/KB/vb/registry_with_vb.aspx
To run application on window startup
Sample Code.
'Write to register
Dim regKey As Microsoft.Win32.RegistryKeyregKey
regKey = Registry.LocalMachine.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Run", True)
regKey.SetValue("YourApplicationName", "YourInstallPath")
regKey.Close()
如果要从注册中删除,请使用此代码.
If you want to remove from register use this code.
regKey.DeleteValue("YourApplicationName", False)
还要查看此链接: http://oreilly.com/pub/a/oreilly/windows/ron/startup_0401.html
Also look at this Link : http://oreilly.com/pub/a/oreilly/windows/ron/startup_0401.html
简单的方法是
从运行打开regedit
转到
SOFTWARE \ Microsoft \ Windows \ CurrentVersion \ Run
右键单击->新->字符串值->输入名称(例如"DEMO")->
右键单击演示->修改->将您的exe文件粘贴到值数据中(例如c:\ project \ hello.exe)->好的,然后重新启动PC.
simple way is
open regedit from run
go to
SOFTWARE\Microsoft\Windows\CurrentVersion\Run
right click -> new -> string Value -> give name (like "DEMO") ->
right click on Demo -> modify -> paste your exe file in value data (like c:\project\hello.exe) -> ok and restart your PC.
这篇关于想要使vb.net应用程序在部署时在启动时运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!