When i choose avi->open with->mycsharp.exe in explorer how I get

  • Thread starter Thread starter Bilo
  • Start date Start date
B

Bilo

I have a Windows Forms Application.
When I choose avi->open with->mycharp.exe in explorer how I can get the path
and the filename of the avi.
Currently the static void main looks like:

static void Main()
{
Application.Run(new Form1());
}

must I make a new Constructor Form1(string filename)? But than i dont know
how to make the static void main funktion.
 
Bilo said:
I have a Windows Forms Application.
When I choose avi->open with->mycharp.exe in explorer how I can get the path
and the filename of the avi.
Currently the static void main looks like:

static void Main()
{
Application.Run(new Form1());
}

must I make a new Constructor Form1(string filename)? But than i dont know
how to make the static void main funktion.

Go ahead and add a new constructor to your form. Then try this:

static void Main(string[] args)
{
if (args.Length > 0)
Application.Run(new Form1(args[0]));
}

Erik
 
Thx that you have take the time to help me.
This looks good.

Erik Frey said:
Bilo said:
I have a Windows Forms Application.
When I choose avi->open with->mycharp.exe in explorer how I can get the path
and the filename of the avi.
Currently the static void main looks like:

static void Main()
{
Application.Run(new Form1());
}

must I make a new Constructor Form1(string filename)? But than i dont know
how to make the static void main funktion.

Go ahead and add a new constructor to your form. Then try this:

static void Main(string[] args)
{
if (args.Length > 0)
Application.Run(new Form1(args[0]));
}

Erik
 
Back
Top