string path = Path.GetDirectoryName(filePath); string fileName = Path.GetFileName(filePath); // create the shell application object dynamic shellApplication = Activator.CreateInstance(Type.GetTypeFromProgID("Shell.Application")); dynamic directory = shellApplication.NameSpace(path); dynamic link = directory.ParseName(fileName); dynamic verbs = link.Verbs(); for (int i = 0; i < verbs.Count(); i++) { dynamic verb = verbs.Item(i); var name = verb.Name; if (verb.Name.Equals(localizedVerb)) { verb.DoIt(); return true; } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)