472,325 Members | 2,279 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,325 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 5482
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...
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...
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...
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...
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...
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'...
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...
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...
0
by: tammygombez | last post by:
Hey fellow JavaFX developers, I'm currently working on a project that involves using a ComboBox in JavaFX, and I've run into a bit of an issue....
0
by: tammygombez | last post by:
Hey everyone! I've been researching gaming laptops lately, and I must say, they can get pretty expensive. However, I've come across some great...
0
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: CD Tom | last post by:
This happens in runtime 2013 and 2016. When a report is run and then closed a toolbar shows up and the only way to get it to go away is to right...
0
by: CD Tom | last post by:
This only shows up in access runtime. When a user select a report from my report menu when they close the report they get a menu I've called Add-ins...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
0
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...

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.