Tuesday, 20 August 2013

Get Multiple Files Path with Right Click

Get Multiple Files Path with Right Click

I have added my application to the right click menu of Windows with the
help of the registry
"C://myapp.exe "%1"
I am able to get the path of the selected file in a MessageBox using the
below code. It is okay if I want to open a single file, but if I select
multiple files, it runs multiple instances of my application. I need the
path of all selected file in the single instance only. Can anyone give me
an idea of how to do this?
static void Main(string[] args)
{
foreach (string path in args)
{
MessageBox.Show(path);
}
}

No comments:

Post a Comment