Solved

Update registry settings using .NET

Posted on 2004-09-21
10
1,552 Views
Last Modified: 2008-03-17
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
Comment
Question by:bLUE
  • 4
  • 3
10 Comments
 
LVL 8

Expert Comment

by:bramsquad
ID: 12113713
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
 
LVL 1

Author Comment

by:bLUE
ID: 12113754
Hi. Will that actully work since, DefaultConnectionSettings value holds a lot of other settings too?
0
 
LVL 8

Expert Comment

by:bramsquad
ID: 12113784
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
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
LVL 1

Author Comment

by:bLUE
ID: 12113851
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
 
LVL 8

Expert Comment

by:bramsquad
ID: 12114108
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
 
LVL 1

Author Comment

by:bLUE
ID: 12114204
yeh i see what you mean, but I dont know which bit of the binary code is specific to that value :/
0
 
LVL 8

Accepted Solution

by:
bramsquad earned 125 total points
ID: 12114672
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

The object model of .Net can be overwhelming at times – so overwhelming that quite trivial tasks often take hours of research. In this case, the task at hand was to populate the datagrid from SQL Server database in Visual Studio 2008 Windows applica…
Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now