vb6.0做的软件怎么样能让软件安装后开机自动运行?

来源:百度知道 编辑:UC知道 时间:2024/07/04 08:31:48
vb6.0做的软件怎么样能让软件安装后开机自动运行?

misrosoft是这么做的“clock”是程序名称。

'Requires the Trial or Release version of Visual Studio .NET Professional (or greater).
Imports Microsoft.Win32

Public Class RegSettings
Const RunAtStartupKey As String = "Software\Microsoft\Windows\CurrentVersion\Run"
Public Shared Property RunAtStartUp() As Boolean
Get
Try
Dim key As RegistryKey = Registry.CurrentUser.OpenSubKey(RunAtStartupKey)
Return CStr(key.GetValue("Clock", String.Empty)) <> String.Empty
Catch
' No errors if something goes wrong.
' Just fail silently.
End Try
End Get

Set(ByVal Value As Boolean)
Try
Dim key As RegistryKey = Registry.CurrentUser.OpenSubKey(RunAtStartupKey, True)
If Value Then