troubleshooting Question

Writing to registry in vb.net 2013

Avatar of tompowers2474
tompowers2474 asked on
Visual Basic.NET.NET ProgrammingWindows 7
2 Comments1 Solution158 ViewsLast Modified:
Hey Guys

I am clueless yes  I write in VB .NET CAUSE I'M NOT THAT GOOD AT  PROGRAMMING ANYWAY ALL I WANT  TO DO IS JUST  WRITE  A FEW VALUES FOR A AUTOLOGON USING VB.NET HOW WRONG  AM I

Imports Microsoft.Win32

Public Class Form1
    Dim regKey As RegistryKey
    Dim regKey1 As RegistryKey

    Dim regKey2 As RegistryKey
    Dim regKey3 As RegistryKey
    ' Public Function  
    Public Function CreateSubKey(subkey As String, permissionCheck As Microsoft.Win32.RegistryKeyPermissionCheck) As Microsoft.Win32.RegistryKey
    End Function
    Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
        txtTimeandDATE.Text = Date.Now
    End Sub
    Public Sub Labs()
        txtPass.Text = "Nazareth1"
        regKey = Registry.LocalMachine.CreateSubKey("\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", True)
        regKey.SetValue("AutoAdminLogon", "1")
        regKey1 = Registry.LocalMachine.CreateSubKey("\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", True)
        regKey1.SetValue("DefaultDomainName", "ONE")
        regKey2 = Registry.LocalMachine.CreateSubKey("\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", True)
        regKey2.SetValue("DefaultUserName", cmbUser.SelectedValue)
        regKey3 = Registry.LocalMachine.CreateSubKey("\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", True)
        regKey3.SetValue("DefaultPassword", txtPass.Text)
    End Sub
please help thanks guys
ASKER CERTIFIED SOLUTION
Éric Moreau
Senior .Net Consultant
Join our community to see this answer!
Unlock 1 Answer and 2 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros