Avatar of tompowers2474
tompowers2474
 asked on

Writing to registry in vb.net 2013

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

Open in new window

please help thanks guys
Visual Basic.NET.NET ProgrammingWindows 7

Avatar of undefined
Last Comment
tompowers2474

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Éric Moreau

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
tompowers2474

ASKER
Thank You
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck