Code
1 string fileName = openFileDialog1.FileName.ToString();
2 string dirPath = "C:\\";
3 string ext = fileName.Substring(fileName.LastIndexOf(".")) ;
4 if (ext == ".lnk")
5 {
6 IWshRuntimeLibrary.WshShell shell = new IWshRuntimeLibrary.WshShellClass();
7 IWshRuntimeLibrary.IWshShortcut shortcut = (IWshRuntimeLibrary.IWshShortcut)shell.CreateShortcut(fileName);
8 dirPath = shortcut.TargetPath;
9 }
1 string fileName = openFileDialog1.FileName.ToString();
2 string dirPath = "C:\\";
3 string ext = fileName.Substring(fileName.LastIndexOf(".")) ;
4 if (ext == ".lnk")
5 {
6 IWshRuntimeLibrary.WshShell shell = new IWshRuntimeLibrary.WshShellClass();
7 IWshRuntimeLibrary.IWshShortcut shortcut = (IWshRuntimeLibrary.IWshShortcut)shell.CreateShortcut(fileName);
8 dirPath = shortcut.TargetPath;
9 }