We help IT Professionals succeed at work.
Get Started

Writing  to registry in vb.net   2013

152 Views
Last Modified: 2016-03-07
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
Comment
Watch Question
Senior .Net Consultant
CERTIFIED EXPERT
Top Expert 2016
Commented:
This problem has been solved!
Unlock 1 Answer and 2 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE