Well, first we need to understand what happens when you drag a file onto an exe in windows. Really all it does is open the exe with the file as a command line argument.
for example writing:
Test.exe file.txt
in the command line
would be the same as dragging file.txt onto test.exe in windows explorer.
so to get that data, you would first need to know what is contained in that command line argument:
vb.net Code:
If Environment.GetCommandLineArgs.Count > 1 Then
MsgBox(Environment.GetCommandLineArgs(1).ToString)
End If
This will check to see if your program was launched with an argument (argument 0 is always your program itself). And then it shows what it is by using a messagebox.
I'm pretty sure setting a file association works the same way, so if you associate a file with your program it will still open using this code.