وضع برنامجك في بدء التشغيل للمستخدم الحالي
Imports Microsoft.Win32 Imports System.Windows.Forms Public Sub RunatStartup(ByVal PutAtStartup As Boolean , ByVal ProgramName As String) Dim StartupPath As String = "Software\Microsoft\Windows\CurrentVersion\Run" Dim MyKey As RegistryKey = Registry.CurrentUser.OpenSubKey(StartupPath , True) If PutAtStartup Then MyKey.SetValue(ProgramName , Application.ExecutablePath) Else Try MyKey.DeleteValue(ProgramName , False) Catch ex As Exception ex = Nothing End Try End If End Sub
المومضوع ممتاز