語言

IDataObject.GetData 方法

定義

擷取指定資料格式的資料物件。

多載

名稱 Description
GetData(String)

以指定格式檢索資料物件;資料格式由字串指定。

GetData(Type)

以指定格式檢索資料物件;資料格式由 Type 物件指定。

GetData(String, Boolean)

以指定格式檢索資料物件,並可選擇將資料轉換為指定格式。

GetData(String)

以指定格式檢索資料物件;資料格式由字串指定。

public:
 System::Object ^ GetData(System::String ^ format);
[System.Security.SecurityCritical]
public object GetData(string format);
public object GetData(string format);
[<System.Security.SecurityCritical>]
abstract member GetData : string -> obj
abstract member GetData : string -> obj
Public Function GetData (format As String) As Object

參數

format
String

一個字串,用來指定要以何種格式檢索資料。 請參閱 DataFormats 該類別以了解一組預設的資料格式。

傳回

一個資料物件,資料以指定格式呈現,若資料無法以指定格式取得,則為 空 物件。

屬性

備註

關於此方法的實作,請參見 GetData。

另請參閱

適用於

GetData(Type)

以指定格式檢索資料物件;資料格式由 Type 物件指定。

public:
 System::Object ^ GetData(Type ^ format);
[System.Security.SecurityCritical]
public object GetData(Type format);
public object GetData(Type format);
[<System.Security.SecurityCritical>]
abstract member GetData : Type -> obj
abstract member GetData : Type -> obj
Public Function GetData (format As Type) As Object

參數

format
Type

一個 Type 指定要以何種格式檢索資料的物件。 請參閱 DataFormats 該類別以了解一組預設的資料格式。

傳回

一個資料物件,資料以指定格式呈現,若資料無法以指定格式取得,則為 空 物件。

屬性

備註

關於此方法的實作,請參見 GetData。

另請參閱

適用於

GetData(String, Boolean)

以指定格式檢索資料物件,並可選擇將資料轉換為指定格式。

public:
 System::Object ^ GetData(System::String ^ format, bool autoConvert);
[System.Security.SecurityCritical]
public object GetData(string format, bool autoConvert);
public object GetData(string format, bool autoConvert);
[<System.Security.SecurityCritical>]
abstract member GetData : string * bool -> obj
abstract member GetData : string * bool -> obj
Public Function GetData (format As String, autoConvert As Boolean) As Object

參數

format
String

一個字串,用來指定要以何種格式檢索資料。 請參閱 DataFormats 該類別以了解一組預設的資料格式。

autoConvert
Boolean

true 嘗試自動將資料轉換成指定格式; false 無需資料格式轉換。

若參數為 false,則方法回傳指定格式的資料(若有),或 null 資料無法取得指定格式。

傳回

一個資料物件,資料以指定格式呈現,若資料無法以指定格式取得,則為 空 物件。

屬性

備註

關於此方法的實作,請參見 GetData。

另請參閱

適用於