Opening application with file

Hi guys :)

I want to add extension that my application will support, however where does the file argument appear...

does it add here:

static void Main(string[] args)

or what
How do I get the Filename and location


P.S.
this is Graphical Application



Answer this question

Opening application with file

  • EdwinLam

    add following key to registry


    [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.pippo]
        @ =appname

    [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\appname]
    @="Pippo file"
    "EditFlags"=hex:00,00,00,00

    [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\appname\DefaultIcon]
    @="C:\\apppath\\appname.exe,0"

    [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\appname\shell]

    [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\appname\shell\open]

    [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\appname\shell\open\command]
    @="\"C:\\apppath\\WinRAR.exe\" \"%1\""
        


  • laszlo.gosztola

    Just check it with args.length - if it is more then 0 then your file is in the args[0] parameter...
  • Jean St-Arneault

    I know about this,. But if i double click a file that is associating to my Application, how can My application know about it

    How can I actually know I am being run with a file and I need to know it's location.


  • Opening application with file