Clipboard獲取內容C#

一。獲取文本
  textBox1.Text = Clipboard.GetData("Text").ToString();


二。獲取圖像

            pictureBox1.Image = Clipboard.GetImage();
三。GetData()的參數解釋

名稱 說明
   Bitmap   指定 Microsoft Windows 位圖數據格式。      CommaSeparatedValue   指定以逗號分隔的值 (CSV) 數據格式。      Dib   指定 device-independent bitmap (DIB) 數據格式。      Dif   指定 Windows 數據交換格式 (DIF) 數據格式。      EnhancedMetafile   指定 Windows 加強型圖元文件格式。      FileDrop   指定 Windows 文件放置格式。      Html   指定 HTML 數據格式。      Locale   指定 Windows 區域設置(區域性)數據格式。      MetafilePicture   指定 Windows 圖元文件圖片數據格式。      OemText   指定標準 Windows OEM 文本數據格式。      Palette   指定 Windows 調色板數據格式。      PenData   指定 Windows 鋼筆數據格式。      Riff   指定 Resource Interchange File Format (RIFF) 音頻數據格式。      Rtf   指定 Rich Text Format (RTF) 數據格式。      Serializable   指定封裝任何類型的可序列化數據對象的數據格式。      StringFormat   指定 common language runtime (CLR) 字符串類數據格式。      SymbolicLink   指定 Windows 符號連接數據格式。      Text   指定 ANSI 文本數據格式。      Tiff   指定 Tagged Image File Format (TIFF) 數據格式。      UnicodeText   指定 Unicode 文本數據格式。      WaveAudio   指定波形音頻數據格式。      Xaml   指定 Extensible Application Markup Language (XAML) 數據格式。      XamlPackage   指定 Extensible Application Markup Language (XAML) 包數據格式。
相關文章
相關標籤/搜索