473,395 Members | 2,222 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

copy files from clipboard

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
2 5561
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: tabonni | last post by:
Hi all I want to create an ASP page, which can copy the real PDF files into the clipboard and then the user can paste it in Outlook message as attachments(it's like inserting attachments) My...
5
by: tabonni | last post by:
Hello All I am creating an ASP page. There are a list of filename and checkbox next to it. When user checked all the documents they want and click ADD TO CLIPBOARD button. All filepaths will be...
5
by: DraguVaso | last post by:
Hi, I'm looking for a way to Copy and Paste Files to the clipboard. I found a lot of articles to copy pieces of text and bitmaps etc, but nog whole files. Whay I need is like you have in...
2
by: Keith | last post by:
I'm trying to come up with a way to create a contextmenu that will do all the "standard" functions (cut, copy, paste, undo, etc). There seems to be a lot of information out there - but nothing...
7
by: lgbjr | last post by:
Hello All, I¡¯m using a context menu associated with some pictureboxes to provide copy/paste functionality. Copying the image to the clipboard was easy. But pasting an image from the clipboard...
9
by: Alan T | last post by:
Any source code example I can use to save the clipboard content to an object, then I will do a copy and paste, finally put back the 'saved' clipboard content back to clipboard ?
17
by: Steve | last post by:
I'm trying to code cut, copy, and paste in vb 2005 so that when the user clicks on a toolbar button, the cut/copy/paste will work with whatever textbox the cursor is current located in (I have...
6
by: Fred | last post by:
I retreive files from the clipboard as below. Dim DObj As IDataObject = Clipboard.GetDataObject If DObj.GetDataPresent(DataFormats.FileDrop) Then Dim files As String() = _...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.