我如何在C#中實現類似的功能?Getters和Setters的簡單C#註冊表對象
object Registry;
Registry = MyProj.Registry.Instance;
int Value;
Value = 15;
Registry.Value = Value; /* Sets it to 15 */
Value = 25;
Value = Registry.Value; /* Returns the 15 */
到目前爲止,我有這個對象:
namespace MyProj
{
internal sealed class Registry
{
static readonly Registry instance = new Registry();
static Registry()
{
}
Registry()
{
}
public static Registry Instance
{
get
{
return instance;
}
}
}
}
是關於Windows註冊表中的問題或者說是「Regsitry的名字只是一個conincidence? – M4N 2009-10-08 11:35:20