Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Some C# questions.
Message
From
04/01/2007 00:12:53
 
 
To
03/01/2007 16:21:01
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
01181975
Message ID:
01182096
Views:
23
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform