I have a peculiar problem, I have created a code to be able to organize and execute shortcuts, but my problem is with the OpenFileDialog Class.
After having put a filter on it, so that it only finds .exe, it turns out that it is unable to differentiate between an .exe and a .url that imitates an .exe.
OpenFileDialog file = new OpenFileDialog();
file.Filter = "Executable (*.exe)|*.exe";
if (file.ShowDialog() == DialogResult.OK && file.CheckPathExists && file.CheckFileExists)
{
textResult.ReadOnly = false;
textResult.Text = System.IO.Path.GetFullPath(file.FileName);
textResult.ReadOnly = true;
}
In the image set as despite the .exe filter, it shows both the direct access of the .exe and that of a url and if you select the one of the url, "Catastrophic failure" appears.
Any ideas?.