Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Set a Dword Value Key To Registry C#

Posted on 2011-02-24
3
Medium Priority
?
4,367 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 16

Accepted Solution

by:
sjklein42 earned 2000 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
 

Author Closing Comment

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

=> RegistryValueKind.DWord
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Assume you have an outside contractor who comes in seasonally or once a week to do some work in your office, but you only want to give him access to the programs and files he needs and keep all other documents and programs private. Can you do this o…
On some Windows 7 (SP1) computers, Windows Update becomes super slow even the computer is reasonably fast.  There's one solution that seemed to have worked well for me (after trying a few other suggested solutions).
This Micro Tutorial will give you a introduction in two parts how to utilize Windows Live Movie Maker to its maximum editing capability. This will be demonstrated using Windows Live Movie Maker on Windows 7 operating system.
The viewer will learn how to successfully download and install the SARDU utility on Windows 7, without downloading adware.
Suggested Courses

604 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