rishi roy

rishi roy

  • NA
  • 8
  • 25.2k

Registry value

Jul 29 2010 11:34 PM
How I set Registry value in my registry?
plz help me..!

Answers (4)

1
Tanmay Sarkar

Tanmay Sarkar

  • 0
  • 1.5k
  • 1m
Jul 29 2010 11:38 PM
First read some article for Registry.
Try this code....

using Microsoft.Win32;

private void button1_Click(object sender, EventArgs e)

        {

            try

            {

                RegistryKey regkey = Registry.CurrentUser;

                regkey = regkey.CreateSubKey (@"Software\Tanmay\Sample"); //path

                if (regkey != null)

                {

                    regkey.SetValue("Test", "Hello World"); //Value Name,Value Data

                }

            }

            catch (Exception ex)

            {

                MessageBox.Show(ex.Message);

            }

        }


Mark it as answer if it help you.

Thank you.


Accepted Answer
0
Tanmay Sarkar

Tanmay Sarkar

  • 0
  • 1.5k
  • 1m
Jul 30 2010 11:32 PM
Thank you sir. May be I am too younger, so i could not tolerate that, where i know this is the registry access way. So I wrote my previous post.

But after reading your post, i think world is complex. I visit your profile & few others member who support me in my problem, & i shocked to see some people also dislike them.


But i keep your word. And never mind that thumbs down vote....
But the person if he/she has better code can share with us!

Ok don't worry....

Thank you sir, thank you so much ....
[now you can see 11+me =12 are thumbs up for you]  :-)
0
Sam Hobbs

Sam Hobbs

  • 54
  • 29.3k
  • 2.1m
Jul 30 2010 10:02 PM

I agree that it would be interesting to know why someone voted down your response. I agree that they should share with us what they consider to be better.
 
Don't worry about it, though; it happens. There are many unhappy people in the world and it is not your fault that they are unhappy.
 
If you look at my profile, 11 people voted thumbs up for me and 6 people voted thumbs down. If people voted thumbs down for me due to a misunderstanding, then I wish I could explain. I do sometimes tell people that they should search for answers, and people don't like that. Since I say things like that, I am not surprised that some people vote me down.
 
I don't see anything you have said that should offend anyone, so don't worry about it.
0
Tanmay Sarkar

Tanmay Sarkar

  • 0
  • 1.5k
  • 1m
Jul 30 2010 12:43 PM
You accept my ans and somebody dislike it--- i could not understand.
I asked those man who dislike this post please,
If there is better code please put it here we learn from that.

Thank you.