16-12-12, 09:52 PM
16-12-12, 10:25 PM
16-12-12, 10:41 PM
بارك الله فيك وجزاك الله خيرا
جاري تجربة الاكواد
جاري تجربة الاكواد
17-12-12, 06:39 PM
السلام عليكم ورحمة الله وبركاته
مثالين لوضع البرنامج في بدء التشغيل
المثال الاول
مثالين لوضع البرنامج في بدء التشغيل
المثال الاول
كود :
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim regKey As Microsoft.Win32.RegistryKey
Dim KeyName As String = "test"
Dim KeyValue As String = "C:\test.exe"
regKey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Run", True)
If regKey.GetValue(KeyName) = Nothing Then
MsgBox("no value found")
regKey.SetValue(KeyName, KeyValue, Microsoft.Win32.RegistryValueKind.String)
MsgBox("key" & KeyName & "has been created")
Else
MsgBox("this programm already exists ", vbInformation, "Information")
End If
End Sub
End Classالمثال الثاني
كود :
Imports Microsoft.Win32كود :
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim regKey As RegistryKey
regKey = Registry.LocalMachine.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Run", True)
regKey.SetValue("MyExecutable", "C:\MyExecutable.exe")
regKey.Close()
End Sub
End Classبالتوفيق للجميع جزاكم الله خيرا