Share via


ClipboardProxy.GetFileDropList 方法

定义

从剪贴板上检索表示文件名的字符串的集合。

public:
 System::Collections::Specialized::StringCollection ^ GetFileDropList();
public System.Collections.Specialized.StringCollection GetFileDropList ();
member this.GetFileDropList : unit -> System.Collections.Specialized.StringCollection
Public Function GetFileDropList () As StringCollection

返回

包含文件名的 StringCollection;如果剪贴板中不包含任何格式为 FileDrop 或可转换为该格式的数据,则为 Nothing

示例

此示例确定剪贴板上是否有文件下拉列表,并将该列表添加到 ( ListBox.lstFiles 如果存在)。

If My.Computer.Clipboard.ContainsFileDropList Then
   Dim filelist = My.Computer.Clipboard.GetFileDropList()
   For Each filePath In filelist
       lstFiles.Items.Add(filePath)
   Next
End If

如果没有名为 lstFilesListBox ,则此代码将创建异常。

注解

此方法仅适用于非服务器应用程序。

文件下拉列表是包含文件路径信息的字符串集合。

可用性(按项目类型)

项目类型 可用
Windows 应用程序
类库
控制台应用程序
Windows 控件库
Web 控件库
Windows 服务
网站

适用于

另请参阅