Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Something like .h files in VFP
Message
De
05/08/2004 09:38:48
 
 
À
05/08/2004 09:29:52
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00930980
Message ID:
00930986
Vues:
11
Alvaro,

The way I do it is to define a class and store the strings and other data elements as static properties. That way other forms and programs can read from this class and get the values that were previously set earlier in the program. For instance...
using System;

public class globals
{
	private static string _cUserName;
	public static string cUserName
	{
		get {return _cUserName ;}
		set {_cUserName = value;}
	}
}
In one form, I can do...

globals.cUserName = "Kevin";

And then in later forms, I can display from this information...

MessageBox.Show("Current user is " + globals.cUserName);

Hope this helps...
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform