By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,366 Members | 1,242 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,366 IT Pros & Developers. It's quick & easy.

copy files from clipboard

P: n/a
Hi all,

I would like to copy FILES from the clipboard to a desired folder from
VB.NET.
I was able to copy files (with filedrop data format) to the clipboard but I
don't know
how to catch this data (the entire data) and leave it (copy it) to a folder.
It doen't matter if the data I want to copy is a folder, a file or a group
of them. The
fact is I would like to copy the WHOLE data with a function.
Any ideas?
Thanks a lot,
Xavier Valdés
Nov 21 '05 #1
Share this Question
Share on Google+
2 Replies

P: n/a
Thanks a lot,
Cor!

"Cor Ligthert" <no************@planet.nl> escribió en el mensaje
news:ec****************@TK2MSFTNGP15.phx.gbl...
Xavier,

I saw that I had an old sample I once made

\\\
'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.Selecte dPath _
& System.IO.Path.GetFileName(clipbrd(i))) Then
System.IO.File.Move(folderbrowserDialog1.SelectedP ath & _
"\" & _
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.Selecte dPath _
& "temptemptemp.temp") Then
System.IO.File.Delete(folderbrowserDialog1.Selecte dPath & _
"temptemptemp.temp")
End If
///

I hope this helps?

Cor

"Xavier Valdés" <no*****@teleline.es>
Hi all,

I would like to copy FILES from the clipboard to a desired folder from
VB.NET.
I was able to copy files (with filedrop data format) to the clipboard but
I don't know
how to catch this data (the entire data) and leave it (copy it) to a
folder.
It doen't matter if the data I want to copy is a folder, a file or a
group of them. The
fact is I would like to copy the WHOLE data with a function.
Any ideas?
Thanks a lot,
Xavier Valdés


Nov 21 '05 #2

P: n/a
Xavier,

I saw that I had an old sample I once made

\\\
'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.Selecte dPath _
& System.IO.Path.GetFileName(clipbrd(i))) Then
System.IO.File.Move(folderbrowserDialog1.SelectedP ath & _
"\" & _
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.Selecte dPath _
& "temptemptemp.temp") Then
System.IO.File.Delete(folderbrowserDialog1.Selecte dPath & _
"temptemptemp.temp")
End If
///

I hope this helps?

Cor

"Xavier Valdés" <no*****@teleline.es>
Hi all,

I would like to copy FILES from the clipboard to a desired folder from
VB.NET.
I was able to copy files (with filedrop data format) to the clipboard but
I don't know
how to catch this data (the entire data) and leave it (copy it) to a
folder.
It doen't matter if the data I want to copy is a folder, a file or a group
of them. The
fact is I would like to copy the WHOLE data with a function.
Any ideas?
Thanks a lot,
Xavier Valdés

Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.