Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1565
  • Last Modified:

Update registry settings using .NET

Hello.

In Internet explorer, if you go
Tools > Internet Settings > Connections (tab) > LAN settings > 

Theres is a checkbox at the top labelled:
"Automatically detect settings"

I need to write an app that will update this value in the registry. The key associated with it can be found at
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Connections, DefaultConnectionSettings

How do I update binary values using .NET, for true and false values of the checkbox.

Any help would be appreciated. Thanks
0
bLUE
Asked:
bLUE
  • 4
  • 3
1 Solution
 
bramsquadCommented:
Dim key As Microsoft.Win32.RegistryKey
key = Microsoft.Win32.Registry.CurrentUser.CreateSubKey("\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Connections\DefaultConnectionSettings")

key.SetValue("DefaultConnectionSettings", ckBool.Value)

~b
0
 
bLUEAuthor Commented:
Hi. Will that actully work since, DefaultConnectionSettings value holds a lot of other settings too?
0
 
bramsquadCommented:
wait...

what do mean "update binary values...for true and false values of the checkbox"?

and after reading it closer, my code is wront, it creates the key...

0
The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

 
bLUEAuthor Commented:
The key already exists. DefaultConnectionSettings is an existing binary key that contains data for IE connections. I want to update one of those values in that data pool
0
 
bramsquadCommented:
if you know which one you want to change then you could use the hex() function to change the data.

so it would be something like this (and you dont even have to create a variable...this is the only piece of code youll need)

Microsoft.Win32.Registry.CurrentUser.SetValue("Software\Microsoft\Windows\CurrentVersion\Internet Settings\Connections\DefaultConnectionSettings", Hex(123456))

if you need to get the value and then manipulate it, you could GetValue(), make it a string, parse it, change it, concatinate it, and then pass it that way (dont know if itll make that data conversion though)

~b

0
 
bLUEAuthor Commented:
yeh i see what you mean, but I dont know which bit of the binary code is specific to that value :/
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now