Drag Drop getting file type or ID

A

Ames111

Hi i want to be able to determine what type of file is being dragged on
to my form, ive got this:

private void Form1_DragDrop(object sender, DragEventArgs e)
{
//tell me the file type please

}
private void Form1_DragEnter(object sender, DragEventArgs e)
{
e.Effect = DragDropEffects.All;

}

not much i know but its a start

i thought id get it through e.data.getdata but i cant figure it out.

i assumes different file types have some sort of different ID, i want
to check the ID of a certain file type, and capture those types of
files being dragged on to my form.

what are the different types? i understand theres a few issues around
the mail type from outlook?
 
W

WRH

Hello

Look at DataFormats, eg DataFormats.FileDrop etc
eg

if(e.Data.GetDataPresent(DataFormats.xxx) is what I want
then
do stuff..
 
S

Stoitcho Goutsev \(100\)

Ames111,

There are no file type IDs or whatsoever. When you drag files you drag
strings that contain files' full names. You need to recognize your files by
their extensions (which can't be 100% error proof) or open the file and read
some signature in the beginning.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top