I have a .Net C# class where I need to make a variable public. I need to initialize this variable within a method (not within the constructor). However, I don\'t want the
Sure. Make it a property, and make the setter private:
public Int32 SomeVariable { get; private set; }
Then to set it (from within some method in the class):
SomeVariable = 5;