Click here to Skip to main content
15,887,485 members
Home / Discussions / C#
   

C#

 
GeneralRe: PInvoke void * parameter Pin
Jason McPeak14-Mar-09 14:10
Jason McPeak14-Mar-09 14:10 
GeneralRe: PInvoke void * parameter Pin
Luc Pattyn14-Mar-09 16:01
sitebuilderLuc Pattyn14-Mar-09 16:01 
AnswerRe: PInvoke void * parameter Pin
Jason McPeak14-Mar-09 7:12
Jason McPeak14-Mar-09 7:12 
QuestionCan not submit to the server. [modified] Pin
sohighthesky14-Mar-09 5:21
sohighthesky14-Mar-09 5:21 
AnswerRe: Can not submit to the server. Pin
Xmen Real 14-Mar-09 5:56
professional Xmen Real 14-Mar-09 5:56 
AnswerRe: Can not submit to the server. Pin
Navneet Hegde14-Mar-09 8:53
Navneet Hegde14-Mar-09 8:53 
QuestionHow to execute Class without Main? [modified] Pin
Akash Chavhan14-Mar-09 5:19
Akash Chavhan14-Mar-09 5:19 
AnswerRe: How to execute Class without Main? [modified] Pin
Eslam Afifi14-Mar-09 5:51
Eslam Afifi14-Mar-09 5:51 
You MUST have at least one Main method in your application to act as an entry point.
If you have more than one Main method in your application, you can specify the startup object from the project's properties. But it's not the case here.
[Edit]Xmen is correct. I was talking about executables. I forgot about libraries.[/Edit]

The method you have here is a static constructor, a method that will be called only the first time you use that class in any way.
You can create objects from that class normally just like any other classes.
static void Main(string[] args)
{
    StaticTest s1 = new StaticTest(); // first time to use StaticTest class, the static constructor
                                      // will be executed before the creation of the object.
    StaticTest s2 = new StaticTest();
    StaticTest s3 = new StaticTest();
}


Eslam Afifi

modified on Saturday, March 14, 2009 12:09 PM

AnswerRe: How to execute Class without Main? Pin
Xmen Real 14-Mar-09 5:53
professional Xmen Real 14-Mar-09 5:53 
AnswerRe: How to execute Class without Main? Pin
Christian Graus14-Mar-09 8:18
protectorChristian Graus14-Mar-09 8:18 
AnswerRe: How to execute Class without Main? Pin
PIEBALDconsult14-Mar-09 15:00
mvePIEBALDconsult14-Mar-09 15:00 
QuestionSockets in C# Pin
mrithula814-Mar-09 4:42
mrithula814-Mar-09 4:42 
AnswerRe: Sockets in C# Pin
Luc Pattyn14-Mar-09 5:01
sitebuilderLuc Pattyn14-Mar-09 5:01 
AnswerRe: Sockets in C# [modified] Pin
Member 349379914-Mar-09 7:02
Member 349379914-Mar-09 7:02 
GeneralRe: Sockets in C# Pin
mrithula814-Mar-09 20:21
mrithula814-Mar-09 20:21 
QuestionRe: Sockets in C# Pin
Jimmanuel15-Mar-09 1:14
Jimmanuel15-Mar-09 1:14 
GeneralRe: Sockets in C# [modified] Pin
mrithula814-Mar-09 22:06
mrithula814-Mar-09 22:06 
GeneralRe: Sockets in C# Pin
mrithula817-Mar-09 1:07
mrithula817-Mar-09 1:07 
GeneralRe: Sockets in C# Pin
mrithula817-Mar-09 4:04
mrithula817-Mar-09 4:04 
QuestionHow to align the control in the centre. Pin
Pankaj Nikam14-Mar-09 4:21
professionalPankaj Nikam14-Mar-09 4:21 
AnswerRe: How to align the control in the centre. Pin
Xmen Real 14-Mar-09 5:51
professional Xmen Real 14-Mar-09 5:51 
GeneralRe: How to align the control in the centre. Pin
Pankaj Nikam14-Mar-09 7:52
professionalPankaj Nikam14-Mar-09 7:52 
AnswerRe: How to align the control in the centre. Pin
Luis Alonso Ramos14-Mar-09 9:47
Luis Alonso Ramos14-Mar-09 9:47 
QuestionMaximize and not hide taskbar Pin
David Muir14-Mar-09 3:35
David Muir14-Mar-09 3:35 
AnswerRe: Maximize and not hide taskbar Pin
PIEBALDconsult14-Mar-09 4:18
mvePIEBALDconsult14-Mar-09 4:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.