?
Solved

Set a Dword Value Key To Registry C#

Posted on 2011-02-24
3
Medium Priority
?
4,189 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

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Question has a verified solution.

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

Possible fixes for Windows 7 and Windows Server 2008 updating problem. Solutions mentioned are from Microsoft themselves. I started a case with them from our Microsoft Silver Partner option to open a case and get direct support from Microsoft. If s…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
This Micro Tutorial will go in depth within Systems and Security in Windows 7 and will go into detail regarding Action Center, Windows Firewall, System, etc. This will be demonstrated using Windows 7 operating system.
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…
Suggested Courses

765 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