Stop/Start a service
-
that code diplay all current program installed on my computer, i need to control this programs ,when i select program from listbox1 and click button service stop(and anthor button to start)?anyone help me plseae code Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim key As Microsoft.Win32.RegistryKey Dim mainkey As Microsoft.Win32.RegistryKey Dim iLp As Integer mainkey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall") Dim sKeys() As String = mainkey.GetSubKeyNames For iLp = 0 To sKeys.Length - 1 key = mainkey.OpenSubKey(sKeys(iLp), False) ListBox1.Items.Add(key.GetValue("DisplayName") & " - " & key.GetValue("Version")) Next iLp End Sub
Ahmed hassan
modified on Sunday, April 6, 2008 4:55 PM
-
that code diplay all current program installed on my computer, i need to control this programs ,when i select program from listbox1 and click button service stop(and anthor button to start)?anyone help me plseae code Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim key As Microsoft.Win32.RegistryKey Dim mainkey As Microsoft.Win32.RegistryKey Dim iLp As Integer mainkey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall") Dim sKeys() As String = mainkey.GetSubKeyNames For iLp = 0 To sKeys.Length - 1 key = mainkey.OpenSubKey(sKeys(iLp), False) ListBox1.Items.Add(key.GetValue("DisplayName") & " - " & key.GetValue("Version")) Next iLp End Sub
Ahmed hassan
modified on Sunday, April 6, 2008 4:55 PM
Oh, I get it now. Edit your post to add someting to it, don't post anohter.
Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )