How to detect an associated file with your project

ahmad_hamdan

Member
Joined
May 24, 2010
Messages
19
Programming Experience
Beginner
Hello all,

I have a simple program which runs notepad when clicking a button and i created a setup project for that program and assoicated files with extension let's say .xsn to the project and theni build the setup project and installed the software on my PC, now my question is when i run a .xsn file how can i let my program that it's being run by clicking on that file so i can for example read the contents of that file.

Thanks for your help in advance
 
You use the CommandLine Args, which can be easily gotten via Environment.GetCommanLineArgs() or somewhere in the My namespace. It's as easy as looping the array and finding out if the arg is a file or not
 
Back
Top