Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Global Variables C#
Message
De
11/12/2009 21:22:12
 
 
À
11/12/2009 21:09:14
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
C# 3.0
Divers
Thread ID:
01438724
Message ID:
01438739
Vues:
67
Cetin.

I have a class like this called myAppConstants, but I'm interesting in variables, not constants, that span all forms
A good example is the ID of the user who logs into the application.
All forms need that information.
I'm rolling it forward from form to form using properties.
Am I missing something?





>>you again refer to it as:
myApplication.definitions.myConStr

However if value is changed it's only 'definitions' class that you need a recompile (other classes obtain value at runtime despite compile time if it's a field and not a constant). Also with constants and fields you're not limited to simple types and could get the value using a method (and say read from a txt,xml file or ask to user etc). ie:
Anyone who does not go overboard- deserves to.
Malcolm Forbes, Sr.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform