1

I wrote a C# program for converting and re-sizing images. If someone opens a bitmap with my program with "Open With...", how do I "handle" that event and figure out which file they just opened?

Cœur
  • 37,241
  • 25
  • 195
  • 267
jamie
  • 580
  • 5
  • 16

2 Answers2

5

Locate your Main() method

public static void Main(string[] args)
{
   ...
}

the args gets all the command line parameters and the file name should be in there.

Bala R
  • 107,317
  • 23
  • 199
  • 210
4

Use System.Environment.GetCommandLineArgs() or String args[] parameter passed to your Main method. The name of the file that is being opened will be there.