Instead of doing it that way, try this:
string[] args = Environment.GetCommandLineArgs();
foreach(string arg in args)
{
MessageBox.Show(arg);
}
From you ============
thank you ,
but this code will give me the path of the .exe file
but my application is Single-Instance
http://www.codeproject.com/KB/cs/CSSIApp.asp[^]
what i want is when i open .txt file by "Open With" i want my application to give me the path of the .txt in each time i open .txt
My Response ==============
The reason you're seeing that is because your app is already open, and hasn't been shut down and restarted. You have to add some code where you're stopping a second instance from running.