This documentation is archived and is not being maintained.

My.Computer.Clipboard.SetAudio Method

Writes audio data to the Clipboard.

' Usage
My.Computer.Clipboard.SetAudio(audioBytes)
My.Computer.Clipboard.SetAudio(audioStream)
' Declaration
Public Sub SetAudio( _
   ByVal audioBytes As Byte() _
)
' -or-
Public Sub SetAudio( _
   ByVal audioStream As System.IO.Stream _
)

audioBytes

Byte array. Audio data to be written to the Clipboard. Required.

audioStream

Stream Audio data to be written to the clipboard. Required.

No exceptions are thrown by this method.

This method can be used to write the audio data as either a byte array or an audio stream.

Security noteSecurity Note:

Because the Clipboard can be accessed by other users, do not use it to store sensitive information, such as passwords or confidential data.

The following table lists examples of tasks involving the My.Computer.Clipboard.SetAudio method.

This example creates the byte array musicReader, reads the file cool.wav into it, and then writes it to the Clipboard.

Dim musicReader As Byte()
musicReader = My.Computer.FileSystem.ReadAllBytes("cool.wav")
My.Computer.Clipboard.SetAudio(musicReader)

Replace cool.wav with the name and path of the file you wish to read.

Namespace: Microsoft.VisualBasic.MyServices

Class: ClipboardProxy (provides access to Clipboard)

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

No permissions are required.

Show: