Search code examples
c#wpffile-format

How do i get the file path document that is being open by my wpf application?


so i have a c# application that can save and open files. Windows explorer is registered to open that file format with my application. But how do i get the file path of the file that i double clicked in windows explorer?


Solution

  • you get it via commandline - on how to read those arguments see for example

    http://msdn.microsoft.com/de-de/library/system.environment.getcommandlineargs.aspx
    http://msdn.microsoft.com/en-us/library/aa970914.aspx