public string Read(string KeyName) { RegistryKey oldkey = Registry.CurrentUser.OpenSubKey(@"HKEY_CURRENT_USER\Example"); if (oldkey == null) { return null; } else { try { return txtkey.Text = oldkey.GetValue("Name").ToString(); } catch (Exception ex) { throw new Exception(ex.Message); } } }
I change this and it works..
try
{ string currentkey = oldkey.GetValue("amir").ToString(); return txtkey.Text = currentkey; }
© COPYRIGHT 2025 ASPSnippets.com ALL RIGHTS RESERVED.