Solved

Set a Dword Value Key To Registry C#

Posted on 2011-02-24
3
3,559 Views
Last Modified: 2013-12-17
Hi,
I want to change or create a DWORD(reg_dword) key to Registry.

            RegistryKey keyx = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\myapplication", true);
            {
                keyx.SetValue("EnablePORT", "FALSE");
                keyx.Flush();
            }

Open in new window

This code It creates reg_sz. I want to create reg_dword
Please help.

0
Comment
Question by:fancyfanta
3 Comments
 
LVL 16

Accepted Solution

by:
sjklein42 earned 500 total points
ID: 34972573
See this

http://msdn.microsoft.com/en-us/library/microsoft.win32.registryvaluekind.aspx#Y638

            RegistryKey keyx = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\myapplication", true);
            {
                keyx.SetValue("EnablePORT", 0, RegistryValueKind::DWord );
                keyx.Flush();
            }

Open in new window

0
 
LVL 13

Expert Comment

by:agarwalrahul
ID: 34981317
0
 

Author Closing Comment

by:fancyfanta
ID: 34984380
RegistryValueKind::DWord has small syntax error.

=> RegistryValueKind.DWord
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
What's the most efficient way to load up a couple of large table in C#? 5 38
Malware Exploit 5 87
Copy dir and files with robocopy 2 35
hardrive and reformat 5 12
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
When you try to share a printer , you may receive one of the following error messages. Error message when you use the Add Printer Wizard to share a printer: Windows could not share your printer. Operation could not be completed (Error 0x000006…
This Micro Tutorial will give you a basic overview of Windows DVD Burner through its features and interface. This will be demonstrated using Windows 7 operating system.
The viewer will learn how to successfully download and install the SARDU utility on Windows 7, without downloading adware.

896 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

15 Experts available now in Live!

Get 1:1 Help Now