共用方式為


My.Computer.Clipboard Property 

Gets an object that provides methods for manipulating the Clipboard.

' Usage
Dim value As Microsoft.VisualBasic.MyServices.ClipboardProxy = My.Computer.Clipboard
' Declaration
Public ReadOnly Property Clipboard As ClipboardProxy

Return Value

This property returns the My.Computer.Clipboard Object for the computer.

Remarks

This property provides easy access to the My.Computer.Clipboard Object.

This property is available only for non-server applications.

Example

This example reads text from the Clipboard into the string textOnClipboard.

Dim textOnClipboard As String = My.Computer.Clipboard.GetText()

This example fails if there is no text on the Clipboard.

Requirements

Namespace: Microsoft.VisualBasic.Devices

Class: Computer

Assembly: Visual Basic Runtime Library (in Microsoft.VisualBasic.dll)

Availability by Project Type

Project type Available

Windows Application

Yes

Class Library

Yes

Console Application

Yes

Windows Control Library

Yes

Web Control Library

No

Windows Service

Yes

Web Site

No

Permissions

No permissions are required.

See Also

Reference

My.Computer Object
My.Computer.Clipboard Object

Other Resources

Storing Data to and Reading From the Clipboard