Custom File Types

I have created a steup project for my program and have a series of file type I wish to associate which is fine. I just don't quite understand how to get the program to open these files when I click on them I assume you can setup parameters to send to the program
Will I need to modify my main method to allow parameters to be passed to it as well

cheers


Answer this question

Custom File Types

  • Mirza T

    Jason,

    That's correct, you will need a main method that takes parameters, for example:



    private static void Main(string[] args)
    {
         if (args.Length > 0)
         {
             OpenDocument(args[ i]);
         }
    }

     

    Where OpenDocument is responsible for opening your documents (you may want to delay opening it until your Main form has loaded).



  • Alex Ivanoff

    excellent, thanks a lot for that.
  • Custom File Types