VB.Net Tutorial/Development/Clipboard — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
Admin (обсуждение | вклад) м (1 версия) |
(нет различий)
|
Текущая версия на 15:53, 26 мая 2010
My.Computer.Clipboard: Clear, ContainText, SetDataObject and GetText
<source lang="vbnet">Option Strict On Imports System.Windows.Forms Public Module Clipbrd
Public Sub Main() Dim stringToWrite As String = "This data belongs on the Clipboard." Dim stringToRead As String My.ruputer.Clipboard.Clear() Dim data As DataObject = New DataObject(DataFormats.Text, stringToWrite) My.ruputer.Clipboard.SetDataObject(data) If My.ruputer.Clipboard.ContainsText() Then stringToRead = My.ruputer.Clipboard.GetText() Console.WriteLine("The text on the Clipboard: {0}", stringToRead) Else Console.WriteLine("There is no text on the Clipboard.") End If End Sub
End Module</source>
The text on the Clipboard: This data belongs on the Clipboard.