Asset : 4 Button dan 1 TextBox
Imports
Microsoft.Win32
Public Class Form1
Dim regKey As
RegistryKey
Dim REG As Object
'Menghapus String "DICOBA" pada
HKLM\SOFTWARE\HALLO
Private Sub
Button1_Click(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles
Button1.Click
Try
regKey =
Registry.LocalMachine.OpenSubKey("SOFTWARE\HALLO\",
True)
regKey.DeleteValue("DICOBA")
Catch ex As Exception
MsgBox("ERROR")
End Try
End Sub
'Membuat KEY dan String di HKLM\SOFTWARE
Private Sub
Button2_Click(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles
Button2.Click
My.Computer.Registry.LocalMachine.CreateSubKey("SOFTWARE\HALLO\").SetValue("DICOBA", "Word",
Microsoft.Win32.RegistryValueKind.String)
End Sub
'Mengganti Value "DICOBA" pada
HKLM\SOFTWARE\HALLO yang tadinya "word" menjadi "dunia"
Private Sub
Button3_Click(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles
Button3.Click
Try
REG =
CreateObject("wscript.shell")
REG.regwrite("HKEY_LOCAL_MACHINE\SOFTWARE\HALLO\DICOBA",
"1")
Catch ex As Exception
MsgBox("ERROR")
End Try
End Sub
'Membaca Value data "DICOBA"
Private Sub
Button4_Click(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles
Button4.Click
Dim
readValue As String
readValue =
My.Computer.Registry.GetValue("HKEY_LOCAL_MACHINE\SOFTWARE\HALLO", "DICOBA", Nothing)
TextBox1.Text = readValue
End Sub
End Class
0 komentar:
Posting Komentar
Setelah melihat - lihat, Alangkah baiknya memberikan komentar mengenai Blog ini.
Kritik dan Saran teman-teman semua, Saya anggap sebagai masukan buat saya... terima kasih telah berkunjung