My.Computer.Clipboard.SetFileDropList Method
Writes a collection of strings representing file paths to the Clipboard.
' Usage
My.Computer.Clipboard.SetFileDropList(filePaths)
' Declaration
Public Sub SetFileDropList( _
ByVal filePaths As System.Collections.Specialized.StringCollection _
)
Parameters
- filePaths
StringCollection. List of file names. Required.
Remarks
A file drop list is a collection of strings representing file names.
Security Note: |
---|
Because the Clipboard can be accessed by other users, do not use it to store sensitive information, such as passwords or confidential data. |
Example
This example gets the collection of file names from MyDocuments, converts it to a file drop list, and writes it to the Clipboard.
Dim list As System.Collections.ObjectModel.ReadOnlyCollection(Of String)
list = My.Computer.FileSystem.GetFiles _
(My.Computer.FileSystem.SpecialDirectories.MyDocuments)
Dim listReader As New System.Collections.Specialized.StringCollection
For Each item As String In list
listReader.Add(item)
Next
My.Computer.Clipboard.SetFileDropList(listReader)
Requirements
Namespace:Microsoft.VisualBasic.MyServices
Class:ClipboardProxy (provides access to Clipboard)
Assembly: Visual Basic Runtime Library (in Microsoft.VisualBasic.dll)
Availability by Project Type
Project type |
Available |
---|---|
Windows Application |
Yes |
Class Library |
Yes |
Console Application |
Yes |
Windows Control Library |
Yes |
Web Control Library |
No |
Windows Service |
Yes |
Web Site |
No |
Permissions
No permissions are required.
See Also
Reference
System.Collections.Specialized.StringCollection
My.Computer.Clipboard.ContainsFileDropList Method
My.Computer.Clipboard.GetFileDropList Method