C
Carlos Sosa Albert
I'm trying to work with STATIC properties in C#. I have some properties I
get from the registry, so I don't want to instance the class.
I have something like this, but I cannot get it to work. Whenever I try to
access these properties from other classes or project in the same solution
(referenced, of course), I cannot find them...
Would anybody be so kind to give me a hand?
Thanks a lot!!!
----
namespace MyLibrary
{
public static class Config
{
private RegistryKey regMySoft =
Registry.LocalMachine.OpenSubKey("SOFTWARE\\MySoft");
public static String MailServer
{
get
{
return regSoft.GetValue("mailServer").ToString();
}
set
{
regSoft.SetValue("mailServer", value);
}
}
}
}
get from the registry, so I don't want to instance the class.
I have something like this, but I cannot get it to work. Whenever I try to
access these properties from other classes or project in the same solution
(referenced, of course), I cannot find them...
Would anybody be so kind to give me a hand?
Thanks a lot!!!
----
namespace MyLibrary
{
public static class Config
{
private RegistryKey regMySoft =
Registry.LocalMachine.OpenSubKey("SOFTWARE\\MySoft");
public static String MailServer
{
get
{
return regSoft.GetValue("mailServer").ToString();
}
set
{
regSoft.SetValue("mailServer", value);
}
}
}
}