IDataObject.GetDataPresent 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
檢查資料是否可用,或可以轉換成指定的格式。
多載
| 名稱 | Description |
|---|---|
| GetDataPresent(String) |
檢查資料是否可用或可轉換為指定格式;資料格式由字串指定。 |
| GetDataPresent(Type) |
檢查資料是否可用,或可以轉換成指定的格式。 資料格式由 Type 物件指定。 |
| GetDataPresent(String, Boolean) |
檢查資料是否可用,或可以轉換成指定的格式。 一個 |
備註
呼叫 GetDataPresent 以確認該資料物件中是否有指定格式,再呼叫 GetData。
請致電 GetFormats 取得此資料物件中所有可用格式的清單。
GetDataPresent(String)
檢查資料是否可用或可轉換為指定格式;資料格式由字串指定。
public:
bool GetDataPresent(System::String ^ format);
[System.Security.SecurityCritical]
public bool GetDataPresent(string format);
public bool GetDataPresent(string format);
[<System.Security.SecurityCritical>]
abstract member GetDataPresent : string -> bool
abstract member GetDataPresent : string -> bool
Public Function GetDataPresent (format As String) As Boolean
參數
- format
- String
一個字串,用來指定要檢查哪種格式。 請參閱該 DataFormats 類別以了解一組預先定義的資料格式。
傳回
true如果資料是指定格式,或可轉換成指定格式;否則,。 false
- 屬性
備註
關於此方法的實作,請參見 GetDataPresent。
呼叫 GetDataPresent 以確認該資料物件中是否有指定格式,再呼叫 GetData。
請致電 GetFormats 取得此資料物件中所有可用格式的清單。
另請參閱
適用於
GetDataPresent(Type)
檢查資料是否可用,或可以轉換成指定的格式。 資料格式由 Type 物件指定。
public:
bool GetDataPresent(Type ^ format);
[System.Security.SecurityCritical]
public bool GetDataPresent(Type format);
public bool GetDataPresent(Type format);
[<System.Security.SecurityCritical>]
abstract member GetDataPresent : Type -> bool
abstract member GetDataPresent : Type -> bool
Public Function GetDataPresent (format As Type) As Boolean
參數
- format
- Type
Type A是指定要檢查哪種格式的。 請參閱 DataFormats 該類別以了解一組預設的資料格式。
傳回
true如果資料是指定格式,或可轉換成指定格式;否則,。 false
- 屬性
備註
對於此方法的實作,。 GetDataPresent
呼叫 GetDataPresent 以確認該資料物件中是否有指定格式,再呼叫 GetData。
請致電 GetFormats 取得此資料物件中所有可用格式的清單。
另請參閱
適用於
GetDataPresent(String, Boolean)
檢查資料是否可用,或可以轉換成指定的格式。 一個 Boolean 旗標表示如果資料無法以該格式取得,是否需要檢查是否能轉換成指定格式。
public:
bool GetDataPresent(System::String ^ format, bool autoConvert);
[System.Security.SecurityCritical]
public bool GetDataPresent(string format, bool autoConvert);
public bool GetDataPresent(string format, bool autoConvert);
[<System.Security.SecurityCritical>]
abstract member GetDataPresent : string * bool -> bool
abstract member GetDataPresent : string * bool -> bool
Public Function GetDataPresent (format As String, autoConvert As Boolean) As Boolean
參數
- format
- String
一個字串,用來指定要檢查哪種格式。 請參閱該 DataFormats 類別以了解一組預先定義的資料格式。
- autoConvert
- Boolean
false 只檢查指定的格式; true 同時檢查儲存在此資料物件中的資料是否能轉換為指定格式。
傳回
true如果資料是指定格式,或可轉換成指定格式;否則,。 false
- 屬性
備註
關於此方法的實作,請參見 GetDataPresent。
呼叫 GetDataPresent 以確認該資料物件中是否有指定格式,再呼叫 GetData。
請致電 GetFormats 取得此資料物件中所有可用格式的清單。
此方法會在以下情況下返回 true :
autoConvert 參數為 ,
true資料為指定格式,或可轉換為指定格式。autoConvert 參數為 ,
false資料格式為指定格式。
此方法會在以下情況下返回 false :
autoConvert 參數為 且
true資料無法以指定格式取得,且無法轉換成指定格式。autoConvert 參數為
false,且資料無法以指定格式取得。