Dim ob As System.Object = Nothing
Dim ms As System.IO.MemoryStream
ms = e.Data.GetData("attachment format", True)
Dim b(ms.Length) As Byte
ms.Read(b, 0, b.Length)
strfilename = System.Text.Encoding.Unicode.GetString(b)
'//The path/filename is at position 10.
strfilename = strfilename.Substring(10)
strfilename = ctrl.GetLongPathName(strfilename)
If strfilename.EndsWith("pdf", StringComparison.CurrentCultureIgnoreCase) Or _
strfilename.EndsWith("gif", StringComparison.CurrentCultureIgnoreCase) Then
e.Effect = DragDropEffects.Copy
Else
e.Effect = DragDropEffects.None
ms.Close()
Exit Sub
End If
If Not System.IO.File.Exists(strfilename) Then
MsgBox("File not found")
Else
MsgBox("File was found")
End If
ms.Close()
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE