30-11-18, 04:06 AM
اي ممكن اخي ذالك تفضل كتبت لك هذة الاكواد فقط انسخ واعمل التالي
اولا اضف listbox
واضف اداة progressBar1
ثم ضع الكود التالي
مع استبدال الحروف العربية بـ المطلوب فقط
ونتمنى لكم التوفيق اذا افادتك الاجابه عليك باالتقييم
اولا اضف listbox
واضف اداة progressBar1
ثم ضع الكود التالي
مع استبدال الحروف العربية بـ المطلوب فقط
كود :
Imports Microsoft.Win32
Public Class Form1
Dim avast As String
Dim uninstall As RegistryKey
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Application.Exit()
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim value As String
On Error Resume Next
ListBox1.Items.Clear()
uninstall = Registry.LocalMachine.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall")
For Each value In uninstall.GetSubKeyNames
ListBox1.Items.Add(value)
Next
ProgressBar1.Value = 0
If ListBox1.Text = avast Then
Process.Start("ضع هنا مسار البرنامج المطلوب تشغيله مع الصيغه")
Else
Kill("مسار البرنامج المطلوب عدم تشغيله اذا لايوجد في قائمة البرنامج برنامج المطلوب تشغيله ")
End If
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Try
Catch ex As Exception
End Try
Dim selectedProgram, val As String
selectedProgram = ListBox1.SelectedItems.Item(Nothing)
uninstall = Registry.LocalMachine.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" & selectedProgram)
val = uninstall.GetValue("UninstallString")
Try
Process.Start(val)
Catch ex As Exception
MsgBox("Uninstall is Failled For : ' " & ListBox1.SelectedItems.Item(Nothing) & " '", MsgBoxStyle.Critical, "Error")
Exit Sub
End Try
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
On Error Resume Next
Dim selectedProgram, val As String
selectedProgram = ListBox1.SelectedItems.Item(Nothing)
uninstall = Registry.LocalMachine.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" & selectedProgram)
ListBox1.Items.Clear()
For Each val In uninstall.GetValueNames()
ListBox1.Items.Add(val)
Next
End Sub
Private Sub Button3_Click_1(sender As Object, e As EventArgs)
End Sub
Private Sub Button4_Click_1(sender As Object, e As EventArgs)
On Error Resume Next
Dim selectedProgram, val As String
selectedProgram = ListBox1.SelectedItems.Item(Nothing)
uninstall = Registry.LocalMachine.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" & selectedProgram)
ListBox1.Items.Clear()
For Each val In uninstall.GetValueNames()
ListBox1.Items.Add(val)
Next
End Sub
Private Sub Button5_Click(sender As Object, e As EventArgs)
On Error Resume Next
ListBox1.Items.Clear()
uninstall = Registry.LocalMachine.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall")
For Each value In uninstall.GetSubKeyNames
ListBox1.Items.Add(value)
Next
End Sub
Private Sub UnistallToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles UnistallToolStripMenuItem.Click
Dim selectedProgram, val As String
selectedProgram = ListBox1.SelectedItems.Item(Nothing)
uninstall = Registry.LocalMachine.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" & selectedProgram)
val = uninstall.GetValue("UninstallString")
Try
Process.Start(val)
Catch ex As Exception
MsgBox("Uninstall is Failled For : ' " & ListBox1.SelectedItems.Item(Nothing) & " '", MsgBoxStyle.Critical, "Error")
Exit Sub
End Try
ListBox1.Items.Clear()
uninstall = Registry.LocalMachine.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall")
For Each value In uninstall.GetSubKeyNames
ListBox1.Items.Add(value)
Next
ProgressBar1.Value = 100
End Sub
Private Sub ListBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ListBox1.SelectedIndexChanged
End Sub
Private Sub ListBox1_TextChanged(sender As Object, e As EventArgs) Handles ListBox1.TextChanged
End Sub
Private Sub UpdateToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles UpdateToolStripMenuItem.Click
ProgressBar1.Value = 100
End Sub
End Classونتمنى لكم التوفيق اذا افادتك الاجابه عليك باالتقييم
