Registry Basic

Registry Basic – merupakan sebuah program dasar untuk modifikasi registry windows. Jadi bagi yang mau belajar bagaimanakah meng-akses registry dan memodifikasinya melalui program, dibawah ini ada coding dgn syntax Visual Basic. Net.

Imports System
Imports Microsoft.Win32
Public Class Form1
Inherits System.Windows.Forms.Form

" Windows Form Designer generated code "


Private Sub btnTulis_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTulis.Click
Dim Nama As String = txtName.Text
Dim Password As String = txtPass.Text

Dim key As RegistryKey = Registry.LocalMachine.OpenSubKey("Software", True)
Dim newkey As RegistryKey = key.CreateSubKey("RevoLotion")
newkey.SetValue("Nama", Nama)
newkey.SetValue("Password", Password)
End Sub

Private Sub btnHapus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnHapus.Click
Dim delkey As RegistryKey = Registry.LocalMachine.OpenSubKey("Software", True)
delkey.DeleteSubKey("RevoLotion")
End Sub

Private Sub btnRun_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnRun.Click
Shell("Regedit.exe", AppWinStyle.NormalFocus)
End Sub

Private Sub btnLihat_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLihat.Click
Dim pRegKey As RegistryKey = Registry.LocalMachine
pRegKey = pRegKey.OpenSubKey("HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0")
Dim val As Object = pRegKey.GetValue("ProcessorNameString")
MsgBox("Prosesor dari Komputer ini adalah : " + val)
End Sub

Private Sub btnKeluar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnKeluar.Click
Close()
End Sub

End Class


Viva Programming !!!

No comments:

Post a Comment