I'm trying to difference when the user drops a folder or a file but i get a error.
UPDATE
The error is:
Conversion from string "C:\Users\Administrador\Desktop\W" to type 'Long' is not valid.
(Notice that the path, is incomplete)
The IDE highlights this error-line:
If ((attributes And FileAttributes.Directory) = FileAttributes.Directory) Then
I don't know if the problem is in the conversion or what, but if I use a msgbox before the problematic error-line, I can see how the path is correct:
MessageBox.Show(Objetos(0))
If ((attributes And FileAttributes.Directory) = FileAttributes.Directory) Then
This is the sub:
Private Sub TextBox1_DragDrop(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles foldertextbox.DragDrop
If e.Data.GetDataPresent(DataFormats.FileDrop) Then
Dim Objetos As String() = e.Data.GetData(DataFormats.FileDrop)
Dim attributes = Objetos(0)
If ((attributes And FileAttributes.Directory) = FileAttributes.Directory) Then
MsgBox("it's a dir")
Else
MsgBox("it's a file")
End If
foldertextbox.Text = Objetos(0)
userSelectedFolderPath = Objetos(0)
My.Settings.folderpath = Objetos(0)
My.Settings.Save()
playerargs = Nothing
updatecheckboxes()
End If
End Sub