Solved

Code to add registry key value in vb.net

Posted on 2010-09-17
4
755 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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 …
A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

919 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

14 Experts available now in Live!

Get 1:1 Help Now