In my c# Win Form app I am using Drag and Drop feature. A user should drag and drop a folder and my app checks if the folder exist. One user tried drag and drop a link/shotcut and got the error message. It gives me an idea to check on the object dropped if it is a folder, file or link.
Here is my code:
void Form1_DragDrop(object sender, DragEventArgs e)
{
string[] files = (string[])e.Data.GetData(DataFormats.FileDrop);
TB_folder.Text = files[0].Trim();
if (Directory.Exists(TB_folder.Text) != true)
.................
Is there a way to check if the "DragEventArgs e" is a file, link or folder?
Thanks,
zb