Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Some C# questions.
Message
De
04/01/2007 00:12:53
 
 
À
03/01/2007 16:21:01
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
01181975
Message ID:
01182096
Vues:
24
Sam,

The Sub Main() that Mike mentions in his post is VB-speak. In C#, it would be something like this:
[STAThread]
static void Main()
{
	try
	{
		Thread.CurrentThread.CurrentUICulture = System.Globalization.CultureInfo.InvariantCulture;
		Application.Run(new Form1());
	}
	catch (Exception ex)
	{
		MessageBox.Show(ex.Message + (char)13 + (char)13 + ex.TargetSite +
			(char)13 + (char)13 + ex.StackTrace);
	}
}
~~Bonnie



>>>Can C# project have a main program that initiates the application and set up all the variables and procedure/functions etc
>>
>>Do you mean something like setting Sub Main in a Module to be the starting point, doing whatcha want to do in the module, and then opening a form after all of that?
>
>Yes.
>
>In VFP it would set up the general environment for the application.
>You might find statements like:
>
>SET EXCLUSIVE OFF
>SET MULTILOCKS ON
>SET DELETE ON
>
>PUBLIC gcVAR1, gcVAR2....
>etc...
>.
>.
>
>
>and it may launch the login screen for the application.....
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform