1

C# – 複製資料到剪貼簿

 3 years ago
source link: https://fredxxx123.wordpress.com/2008/11/22/c-%e8%a4%87%e8%a3%bd%e8%b3%87%e6%96%99%e5%88%b0%e5%89%aa%e8%b2%bc%e7%b0%bf/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

C# – 複製資料到剪貼簿

今天再弄個小程式給企劃的時候,另外想到的小功能。
於是就找找資料,很簡單的把指定的字串複製到剪貼簿~
HOW TO:將資料加入至剪貼簿
C# 剪貼簿測試

如果要放入自訂資料,需要遵守一些規則,可在上兩篇找到相關資訊。
在這邊還沒用到,所以就不多說~

將字串放到剪貼簿:

 Clipboard.SetData(DataFormats.Text, "123丟進剪貼簿");

第一個參數 – 準備放進去的物件型別。
第二個參數 – 準備放進去的物件。

這是靜態方法,不需要宣告甚麼~
很簡單吧XD

正在載入...

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK