Clipboard.GetData(String) 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
클립보드에서 지정된 형식으로 데이터를 검색합니다.
public:
static System::Object ^ GetData(System::String ^ format);
public static object GetData(string format);
public static object? GetData(string format);
static member GetData : string -> obj
Public Shared Function GetData (format As String) As Object
매개 변수
- format
- String
검색할 데이터의 형식을 지정하는 문자열입니다. 미리 정의된 데이터 형식 집합은 클래스를 DataFormats 참조하세요.
반품
지정된 형식의 데이터를 포함하거나 null 지정된 형식으로 데이터를 사용할 수 없는 개체입니다.
예외
format은 null입니다.
예제
다음 예제에서는이 메서드의 사용을 보여 줍니다.
// After this line executes, IsHTMLDataOnClipboard will be true if
// HTML data is available natively on the clipboard; if not, it
// will be false.
bool IsHTMLDataOnClipboard = Clipboard.ContainsData(DataFormats.Html);
// If there is HTML data on the clipboard, retrieve it.
string htmlData;
if(IsHTMLDataOnClipboard)
{
htmlData = Clipboard.GetText(TextDataFormat.Html);
}
' After this line executes, IsHTMLDataOnClipboard will be true if
' HTML data is available natively on the clipboard; if not, it
' will be false.
Dim IsHTMLDataOnClipboard As Boolean = Clipboard.ContainsData(DataFormats.Html)
' If there is HTML data on the clipboard, retrieve it.
Dim htmlData As String
If IsHTMLDataOnClipboard Then
htmlData = Clipboard.GetText(TextDataFormat.Html)
End If