473,574 Members | 3,190 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 5578
Thanks a lot,
Cor!

"Cor Ligthert" <no************ @planet.nl> escribió en el mensaje
news:ec******** ********@TK2MSF TNGP15.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(B yVal sender _
As Object, ByVal e As System.EventArg s) Handles Button1.Click
Dim folderbrowserDi alog1 As New FolderBrowserDi alog
Dim iData As IDataObject = Clipboard.GetDa taObject()
If iData.GetDataPr esent(DataForma ts.FileDrop) Then
Dim clipbrd As String() = DirectCast(iDat a.GetData(DataF ormats.FileDrop ),
String())
Dim i As Integer
folderbrowserDi alog1.ShowDialo g()
For i = 0 To clipbrd.Length - 1
If System.IO.File. Exists(folderbr owserDialog1.Se lectedPath _
& System.IO.Path. GetFileName(cli pbrd(i))) Then
System.IO.File. Move(folderbrow serDialog1.Sele ctedPath & _
"\" & _
System.IO.Path. GetFileName(cli pbrd(i)), _
folderbrowserDi alog1.SelectedP ath & "temptemptemp.t emp")
End If
System.IO.File. Copy(clipbrd(i) , folderbrowserDi alog1.SelectedP ath & _
"\" & _
System.IO.Path. GetFileName(cli pbrd(i)))
If System.IO.File. Exists(folderbr owserDialog1.Se lectedPath _
& "temptemptemp.t emp") Then
System.IO.File. Delete(folderbr owserDialog1.Se lectedPath & _
"temptemptemp.t emp")
End If
///

I hope this helps?

Cor

"Xavier Valdés" <no*****@teleli ne.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(B yVal sender _
As Object, ByVal e As System.EventArg s) Handles Button1.Click
Dim folderbrowserDi alog1 As New FolderBrowserDi alog
Dim iData As IDataObject = Clipboard.GetDa taObject()
If iData.GetDataPr esent(DataForma ts.FileDrop) Then
Dim clipbrd As String() = DirectCast(iDat a.GetData(DataF ormats.FileDrop ),
String())
Dim i As Integer
folderbrowserDi alog1.ShowDialo g()
For i = 0 To clipbrd.Length - 1
If System.IO.File. Exists(folderbr owserDialog1.Se lectedPath _
& System.IO.Path. GetFileName(cli pbrd(i))) Then
System.IO.File. Move(folderbrow serDialog1.Sele ctedPath & _
"\" & _
System.IO.Path. GetFileName(cli pbrd(i)), _
folderbrowserDi alog1.SelectedP ath & "temptemptemp.t emp")
End If
System.IO.File. Copy(clipbrd(i) , folderbrowserDi alog1.SelectedP ath & _
"\" & _
System.IO.Path. GetFileName(cli pbrd(i)))
If System.IO.File. Exists(folderbr owserDialog1.Se lectedPath _
& "temptemptemp.t emp") Then
System.IO.File. Delete(folderbr owserDialog1.Se lectedPath & _
"temptemptemp.t emp")
End If
///

I hope this helps?

Cor

"Xavier Valdés" <no*****@teleli ne.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
2554
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 idea is: When user checked the checkboxes for the requested PDF files from ASP page and press the "Add To Clipboard" button, all requested PDF files...
5
4322
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 copied into clipboard and then they can right-click -> paste into MS Outlook as attachments. How can I use clipboardData.setData function to do...
5
21010
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 windows explorer: when you do a right-click on a file and choose Copy, and than paste it somewhere in my application and vice versa.
2
2671
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 seems to work for me. A few people refer to txt.copy() txt.paste(), etc. I'm not sure if those are old functions, but they do not work for me. ...
7
11608
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 is proving to be more difficult. These pictureboxes are bound to an AccessDB. If the user wants to add an image, they select an image using an...
9
4810
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
5091
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 about 20 textboxes on the form). Also to ensure that the button can't get used if the cursor isn't in a textbox field. And to ensure the contents of...
6
1255
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() = _ CType(DObj.GetData(DataFormats.FileDrop), String()) This work fine but now I need to know if the user selected cut or copy when putting the file(s) on the clipboard.
0
7805
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7726
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8234
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7815
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6452
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3740
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3749
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1339
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1060
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.