Drag&Drop File to Explorer

  • Thread starter Thread starter Marco Zender
  • Start date Start date
M

Marco Zender

Hello,

i'm in real trouble and don't know how to handle it! May someone can give me
a hint? Following problem: In my application you can drag&drop a file from
the explorer. In my application this file will be encrypted and then you
should be able to drag&drop the file from the application to the explorer.
How can i code the last step ?!? I have tried it with DoDragDrop but without
success :-(

TIA
Marco
 
Hi Marco,

I did once made this sample, but it is the other direction, but maybe it
helps you?

Cor
\\\
'Copy with windows explore some files and than this
Private Sub Button1_Click(ByVal sender _
As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim folderbrowserDialog1 As New FolderBrowserDialog
Dim iData As IDataObject = Clipboard.GetDataObject()
If iData.GetDataPresent(DataFormats.FileDrop) Then
Dim clipbrd As String() =
DirectCast(iData.GetData(DataFormats.FileDrop), String())
Dim i As Integer
folderbrowserDialog1.ShowDialog()
For i = 0 To clipbrd.Length - 1
If System.IO.File.Exists(folderbrowserDialog1.SelectedPath _
& System.IO.Path.GetFileName(clipbrd(i))) Then
System.IO.File.Move(folderbrowserDialog1.SelectedPath & _
"\" & _
System.IO.Path.GetFileName(clipbrd(i)), _
folderbrowserDialog1.SelectedPath & "temptemptemp.temp")
End If
System.IO.File.Copy(clipbrd(i), folderbrowserDialog1.SelectedPath &
_
"\" & _
System.IO.Path.GetFileName(clipbrd(i)))
If System.IO.File.Exists(folderbrowserDialog1.SelectedPath _
& "temptemptemp.temp") Then
System.IO.File.Delete(folderbrowserDialog1.SelectedPath & _
"temptemptemp.temp")
End If
Next
End If
End Sub
///
 
Back
Top