Clipboard.GetText Method

Definition

Returns a string containing the text data on the Clipboard.

Overloads

GetText()

Returns a string containing the UnicodeText data on the Clipboard.

GetText(TextDataFormat)

Returns a string containing text data on the Clipboard.

GetText()

Returns a string containing the UnicodeText data on the Clipboard.

C#
public static string GetText();

Returns

A string containing the UnicodeText data , or an empty string if no UnicodeText data is available on the Clipboard.

Remarks

The UnicodeText data format denotes 16-bit character encoded Unicode, also referred to as UTF-16, and UCS-2.

See also

Applies to

.NET Framework 4.8.1 a ďalšie verzie
Produkt Verzie
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

GetText(TextDataFormat)

Returns a string containing text data on the Clipboard.

C#
public static string GetText(System.Windows.TextDataFormat format);

Parameters

format
TextDataFormat

A member of TextDataFormat that specifies the text data format to retrieve.

Returns

A string containing text data in the specified data format, or an empty string if no corresponding text data is available.

See also

Applies to

.NET Framework 4.8.1 a ďalšie verzie
Produkt Verzie
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10