Clipboard.GetDataObject 方法

定義

傳回資料物件,這個物件代表剪貼簿的整個內容。Returns a data object that represents the entire contents of the Clipboard.

public:
 static System::Windows::IDataObject ^ GetDataObject();
public static System.Windows.IDataObject GetDataObject ();
[System.Security.SecurityCritical]
public static System.Windows.IDataObject GetDataObject ();
static member GetDataObject : unit -> System.Windows.IDataObject
Public Shared Function GetDataObject () As IDataObject

傳回

得以存取系統剪貼簿之整個內容的資料物件,如果剪貼簿上沒有資料,則傳回 nullA data object that enables access to the entire contents of the system Clipboard, or null if there is no data on the Clipboard.

屬性

備註

系統剪貼簿上的資料存取是透過資料物件(也就是可執行 IDataObject 介面的物件)來啟用。Access to data on the system Clipboard is enabled through a data object, that is, an object that implements the IDataObject interface. 預先定義的格式清單是由 DataFormats 類別所定義。A list of predefined formats is defined by the DataFormats class. 使用 DataFormatsIDataObject 和欄位所指定的方法,來檢查和解壓縮資料物件中的資料。Use the methods specified by IDataObject and fields in DataFormats to examine and extract the data from the data object.

若要檢查系統剪貼簿上的資料格式,請在此方法所傳回的資料物件上呼叫 GetFormatsTo examine the formats of data on the system Clipboard, call GetFormats on the data object returned by this method. 若要從系統剪貼簿取出資料,請呼叫 GetData 並指定所需的資料格式。To retrieve data from the system Clipboard, call GetData and specify the desired data format.

系統剪貼簿是由所有應用程式所共用,因此,剪貼簿上的資料可能會由其他應用程式變更。The system Clipboard is shared by all applications, so data on the Clipboard is subject to change by other applications.

適用於

另請參閱