المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Global Variables...



C# Programming
09-19-2009, 07:11 AM
I know I can make a variable global to a class. But What I want to do is set a variable under program.cs where "static void Main(string[] args)" Exists. In this class I want to run a initialization process to activate some variables with values I can call from any point in the application. Such as say a System Code. Is there a means of making a variable global to allow for all classes to see the variable.

My current understanding is this is not possible. Only with in classes unless you pass the variable to the other class. Is this correct?