Opening program by double-clicking associated file, can't get filename!
<p>I have a program that has a file type associated with it (*.cqd). When the user double clicks a .cqd file, it opens up my program just fine, but I can't for the life of me get the name/path of the file used to open the program.</p>

<p>I've tried the following code:</p>

<pre><code>public static void Main(string[] args)
{
    foreach (string s in args)
    {
        MessageBox.Show("MAIN: " + s);
    }
}
</code></pre>

<p>Which only gives me the path of the program itself. </p>

<p>I've also tried:</p>

<pre><code>foreach (string arg in Environment.GetCommandLineArgs())
{
     MessageBox.Show(arg);
}
</code></pre>

<p>Which has the same effect. I'm having a hard time finding information on the topic because my searches give me "How do I open a file with it's associated program?" rather than the problem I'm having. Any help I can get would be appreciated.</p>

<p><strong>NINJA EDIT:</strong> This is not a WPF project. Sorry I wasn't specific on that. I also fixed a quick typo.</p>

<p><strong>FOUND THE PROBLEM!</strong>
When I publish the application, it publishes to a .application file. I went into the project's /bin/release/ folder and found the .exe file. When I drag a file onto the .exe, it properly passes the path into the arguments. Guess I need to read up more on why this is, and if I can get the .application file to work with arguments, seeing as how it has the auto-update of ClickOnce in it.</p>

<p>Thank you all for your help! If there's anything I need to do to close this thread, please let me know.</p>
