I am trying to find out how to open a file by double clicking on the saved file instead of opening it thru the program.
example:
You can double click on a .txt file and it will open up notepad and load the file that you clicked on instead of having to open notepad first and go to open file.
I have all ready made it so .sav files open my program but i don't know how to automatically open them in the program.
Actually if anyone knows how to find out the file you clicked on when your program opens i could do the rest!!!!
Loading
jonPosted Dec 10, 2008, 11:54 AM
jonPosted Dec 10, 2008, 11:23 AM
AlanPosted Dec 2, 2008, 4:22 PM
The path to the file that was clicked on should be passed by Windows as a command line argument to your program i.e.
static void Main(string[] args)
{
string filePath = null;
if (args.Length > 0)
{
filePath = args[0];
}
else
{
// something wrong
return;
}
// rest of code
}