Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Open new instance of C# windows application

I am working in windows environment and I need to open a new instance of my application programmatically while running the application is that possible?

I am greatly appreciative of any guidance or help.

like image 644
Yahya Younes Avatar asked May 21 '11 14:05

Yahya Younes


People also ask

How do I create a new instance of a struct?

We create an instance by stating the name of the struct and then add curly brackets containing key: value pairs, where the keys are the names of the fields and the values are the data we want to store in those fields. We don't have to specify the fields in the same order in which we declared them in the struct.

Which is the correct way to create an instance of struct type?

Struct Instantiation Using new Keyword An instance of a struct can also be created with the new keyword. It is then possible to assign data values to the data fields using dot notation.

How do you create a struct object?

The 'struct' keyword is used to create a structure. The general syntax to create a structure is as shown below: struct structureName{ member1; member2; member3; . . . memberN; };

How does typedef struct work in C?

The C language contains the typedef keyword to allow users to provide alternative names for the primitive (e.g.,​ int) and user-defined​ (e.g struct) data types. Remember, this keyword adds a new name for some existing data type but does not create a new type.


2 Answers

Try this:

var info = new System.Diagnostics.ProcessStartInfo(Application.ExecutablePath);
System.Diagnostics.Process.Start(info );
like image 155
Stecya Avatar answered Oct 16 '22 13:10

Stecya


System.Diagnostics.Process.Start(Application.ExecutablePath);

For a Winforms App.

like image 37
user703016 Avatar answered Oct 16 '22 13:10

user703016