Thursday, May 28, 2009

Writing Registy Using VB.NET

 'function for read registry values

 Public Function writeRegistryValue(ByVal reg_key As String, ByVal val As String) As Boolean
  Dim regKey As RegistryKey
  Dim i As Boolean
  Try
  regKey = Registry.CurrentUser.OpenSubKey("Software\adsdf\asdf", True)
  regKey.SetValue(reg_key, val)
  regKey.Close()
  i = True
  Catch ex As Exception
  i = False
  regKey.Close()
  End Try
  Return i
  End Function

This function is for writing windos regsitry using vb.net

Here reg_key is the registry key and val is value of that key

No comments:

Post a Comment