DataObject.GetText 方法
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
检索此数据对象中的文本数据。
GetText(TextDataFormat) |
检索此数据对象中由指定的 TextDataFormat 值表示的格式的文本数据。 |
GetText() |
检索此数据对象中 UnicodeText 格式的文本数据。 |
- Source:
- DataObject.cs
- Source:
- DataObject.cs
- Source:
- DataObject.cs
检索此数据对象中由指定的 TextDataFormat 值表示的格式的文本数据。
public:
virtual System::String ^ GetText(System::Windows::Forms::TextDataFormat format);
C#
public virtual string GetText(System.Windows.Forms.TextDataFormat format);
abstract member GetText : System.Windows.Forms.TextDataFormat -> string
override this.GetText : System.Windows.Forms.TextDataFormat -> string
Public Overridable Function GetText (format As TextDataFormat) As String
参数
- format
- TextDataFormat
TextDataFormat 值之一。
返回
为此数据对象中的文本数据,如果此数据对象不包含指定格式的数据,则为 Empty。
例外
format
不是有效的 TextDataFormat 值。
注解
ContainsText在使用此方法检索数据之前,使用 方法确定数据对象是否包含文本数据。
SetText使用 方法将文本数据添加到数据对象。
另请参阅
适用于
.NET Framework 4.8.1 和其他版本
产品 | 版本 |
---|---|
.NET Framework | 2.0, 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 |
- Source:
- DataObject.cs
- Source:
- DataObject.cs
- Source:
- DataObject.cs
检索此数据对象中 UnicodeText 格式的文本数据。
public:
virtual System::String ^ GetText();
C#
public virtual string GetText();
abstract member GetText : unit -> string
override this.GetText : unit -> string
Public Overridable Function GetText () As String
返回
为此数据对象中的文本数据,如果此数据对象不包含 Empty 格式的数据,则为 UnicodeText。
注解
ContainsText在使用此方法检索数据之前,使用 方法确定数据对象是否包含文本数据。
SetText使用 方法将文本数据添加到数据对象。
另请参阅
适用于
.NET Framework 4.8.1 和其他版本
产品 | 版本 |
---|---|
.NET Framework | 2.0, 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 |