I have class !
class Reg_v_no_string
{
public static string key_place = "";
public static string key = "";
public static string value = "";
public string reg_value(string key_place, string key)
{
string value = string.Empty;
RegistryKey klase = Registry.CurrentUser;
klase = klase.OpenSubKey(key_place);
value = klase.GetValue(key).ToString();
klase.Close();
return value;
}
}
and this returns blank message box.
How can solve this problem !?
Thanks !
how can i return value from this class ?
I tryed
private void kryptonButton1_Click(object sender, EventArgs e)
{
Reg_v_no_string.key_place = @"Control Panel\Desktop";
Reg_v_no_string.key_place = "WheelScrollLines";
MessageBox.Show(Reg_v_no_string.value);
}
You need to actually call the method:
Also consider some changes to your class:
And then when you call this
staticclass it is like this:Or, to keep it so that it is not static:
Then call it like this: