Solved

Code to add registry key value in vb.net

Posted on 2010-09-17
4
758 Views
Last Modified: 2012-05-10
1)Application checks if registry key exists – “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\<Interface GUID>\tcpAckFrequency”  the interface GUID is known by there being a key for DHCPipAddress key with a value other than nothing (doesn’t exist) or 0.0.0.0.
2)If not add a Dword(32bit) key called TcpAckFrequency as a hex value "1"


PLease see the above requirement and provide the sample code if you have.

Thanks in davance
0
Comment
Question by:futurebuilders
  • 2
4 Comments
 
LVL 2

Accepted Solution

by:
senthil_sivanath earned 250 total points
ID: 33704783
You have to 3 operations
1. Reading registry
2. Changing value of key
3. Adding a new registry

sample code for all the three operations can be found from the following link

http://knol.google.com/k/omar-abid/how-to-use-registry-keys-with-vb-net/3s798vka23618/8#
0
 

Author Comment

by:futurebuilders
ID: 33707135
Below code is giving error as "Requested registry access is not allowed."


reg = Registry.LocalMachine.OpenSubKey("SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{03CBA9E5-BAC9-48B4-834B-3BBA552236E7}", True)
            Dim strKey As String
            strKey = reg.GetValue("AddressType")


Please provide the solution

Thanks
0
 
LVL 12

Assisted Solution

by:Mohamed Abowarda
Mohamed Abowarda earned 250 total points
ID: 33707219
0
 

Author Comment

by:futurebuilders
ID: 33719985
Got Solution
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

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

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

679 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