> For the complete documentation index, see [llms.txt](https://docs.wisej.com/api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.wisej.com/api/wisej.web/general/wisej.web.clipboard.md).

# Clipboard

Namespace: **Wisej.Web**

Assembly: **Wisej.Framework** (4.0.0.0)

Provides methods to place data on and retrieve data from the system Clipboard. This class cannot be inherited.

{% tabs %}
{% tab title="C#" %}

```csharp
public class Clipboard
```

{% endtab %}

{% tab title="VB.NET" %}

```visual-basic
Public Class Clipboard
```

{% endtab %}
{% endtabs %}

## Methods

### ![](/files/lIX317sDtMTZJBi9oSIx) Clear()

Removes all data from the Clipboard.

### ![](/files/lIX317sDtMTZJBi9oSIx) ContainsAudio()

Indicates whether there is data on the Clipboard in the [WaveAudio](/api/wisej.web/enumerations/wisej.web.dataformats.md#fields) format.

**Returns:** [Boolean](https://docs.microsoft.com/dotnet/api/system.boolean). true if there is audio data on the Clipboard; otherwise, false.

### ![](/files/lIX317sDtMTZJBi9oSIx) ContainsData(format)

Indicates whether there is data on the Clipboard that is in the specified format or can be converted to that format.

| Parameter  | Type                                                          | Description                                                                                                                         |
| ---------- | ------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| **format** | [String](https://docs.microsoft.com/dotnet/api/system.string) | The format of the data to look for. See [DataFormats](/api/wisej.web/enumerations/wisej.web.dataformats.md) for predefined formats. |

**Returns:** [Boolean](https://docs.microsoft.com/dotnet/api/system.boolean). true if there is data on the Clipboard that is in the specified *format* or can be converted to that format; otherwise, false.

### ![](/files/lIX317sDtMTZJBi9oSIx) ContainsFileDropList()

Indicates whether there is data on the Clipboard that is in the [FileDrop](/api/wisej.web/enumerations/wisej.web.dataformats.md#fields) format or can be converted to that format.

**Returns:** [Boolean](https://docs.microsoft.com/dotnet/api/system.boolean). true if there is a file drop list on the Clipboard; otherwise, false.

### ![](/files/lIX317sDtMTZJBi9oSIx) ContainsImage()

Indicates whether there is data on the Clipboard that is in the [Bitmap](/api/wisej.web/enumerations/wisej.web.dataformats.md#fields) format or can be converted to that format.

**Returns:** [Boolean](https://docs.microsoft.com/dotnet/api/system.boolean). true if there is image data on the Clipboard; otherwise, false.

### ![](/files/lIX317sDtMTZJBi9oSIx) ContainsText()

Indicates whether there is data on the Clipboard in the [Text](/api/wisej.web/enumerations/wisej.web.textdataformat.md#fields) or [UnicodeText](/api/wisej.web/enumerations/wisej.web.textdataformat.md#fields) format, depending on the operating system.

**Returns:** [Boolean](https://docs.microsoft.com/dotnet/api/system.boolean). true if there is text data on the Clipboard; otherwise, false.

### ![](/files/lIX317sDtMTZJBi9oSIx) ContainsText(format)

Indicates whether there is text data on the Clipboard in the format indicated by the specified [TextDataFormat](/api/wisej.web/enumerations/wisej.web.textdataformat.md) value.

| Parameter  | Type                                                                      | Description                                                                                  |
| ---------- | ------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
| **format** | [TextDataFormat](/api/wisej.web/enumerations/wisej.web.textdataformat.md) | One of the [TextDataFormat](/api/wisej.web/enumerations/wisej.web.textdataformat.md) values. |

**Returns:** [Boolean](https://docs.microsoft.com/dotnet/api/system.boolean). true if there is text data on the Clipboard in the value specified for *format* ; otherwise, false.

### ![](/files/lIX317sDtMTZJBi9oSIx) GetAudioStream()

Retrieves an audio stream from the Clipboard.

**Returns:** [Stream](https://docs.microsoft.com/dotnet/api/system.io.stream). A [Stream](https://docs.microsoft.com/dotnet/api/system.io.stream) containing audio data or null if the Clipboard does not contain any data in the [WaveAudio](/api/wisej.web/enumerations/wisej.web.dataformats.md#fields) format.

### ![](/files/lIX317sDtMTZJBi9oSIx) GetData(format)

Retrieves data from the Clipboard in the specified format.

| Parameter  | Type                                                          | Description                                                                                                                         |
| ---------- | ------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| **format** | [String](https://docs.microsoft.com/dotnet/api/system.string) | The format of the data to retrieve. See [DataFormats](/api/wisej.web/enumerations/wisej.web.dataformats.md) for predefined formats. |

**Returns:** [Object](https://docs.microsoft.com/dotnet/api/system.object). An [Object](https://docs.microsoft.com/dotnet/api/system.object) representing the Clipboard data or null if the Clipboard does not contain any data that is in the specified *format* or can be converted to that format.

### ![](/files/lIX317sDtMTZJBi9oSIx) GetDataObject()

Retrieves the data that is currently on the system Clipboard.

**Returns:** [IDataObject](/api/wisej.web/interfaces/wisej.web.idataobject.md). An [IDataObject](/api/wisej.web/interfaces/wisej.web.idataobject.md) that represents the data currently on the Clipboard, or null if there is no data on the Clipboard.

### ![](/files/lIX317sDtMTZJBi9oSIx) GetFileDropList()

Retrieves a collection of file names from the Clipboard.

**Returns:** [StringCollection](https://docs.microsoft.com/dotnet/api/system.collections.specialized.stringcollection). A [StringCollection](https://docs.microsoft.com/dotnet/api/system.collections.specialized.stringcollection) containing file names or null if the Clipboard does not contain any data that is in the [FileDrop](/api/wisej.web/enumerations/wisej.web.dataformats.md#fields) format or can be converted to that format.

### ![](/files/lIX317sDtMTZJBi9oSIx) GetImage()

Retrieves an image from the Clipboard.

**Returns:** [Image](https://docs.microsoft.com/dotnet/api/system.drawing.image). An [Image](https://docs.microsoft.com/dotnet/api/system.drawing.image) representing the Clipboard image data or null if the Clipboard does not contain any data that is in the [Bitmap](/api/wisej.web/enumerations/wisej.web.dataformats.md#fields) format or can be converted to that format.

### ![](/files/lIX317sDtMTZJBi9oSIx) GetText()

Retrieves text data from the Clipboard in the [Text](/api/wisej.web/enumerations/wisej.web.textdataformat.md#fields) or [UnicodeText](/api/wisej.web/enumerations/wisej.web.textdataformat.md#fields) format, depending on the operating system.

**Returns:** [String](https://docs.microsoft.com/dotnet/api/system.string). The Clipboard text data or [Empty](https://docs.microsoft.com/dotnet/api/system.string.empty) if the Clipboard does not contain data in the [Text](/api/wisej.web/enumerations/wisej.web.textdataformat.md#fields) or [UnicodeText](/api/wisej.web/enumerations/wisej.web.textdataformat.md#fields) format, depending on the operating system.

### ![](/files/lIX317sDtMTZJBi9oSIx) GetText(format)

Retrieves text data from the Clipboard in the format indicated by the specified [TextDataFormat](/api/wisej.web/enumerations/wisej.web.textdataformat.md) value.

| Parameter  | Type                                                                      | Description                                                                                  |
| ---------- | ------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
| **format** | [TextDataFormat](/api/wisej.web/enumerations/wisej.web.textdataformat.md) | One of the [TextDataFormat](/api/wisej.web/enumerations/wisej.web.textdataformat.md) values. |

**Returns:** [String](https://docs.microsoft.com/dotnet/api/system.string). The Clipboard text data or [Empty](https://docs.microsoft.com/dotnet/api/system.string.empty) if the Clipboard does not contain data in the specified format.

### ![](/files/lIX317sDtMTZJBi9oSIx) SetAudio(audioBytes)

Saves the [Byte](https://docs.microsoft.com/dotnet/api/system.byte) array in the [WaveAudio](/api/wisej.web/enumerations/wisej.web.dataformats.md#fields) format after converting it to a [Stream](https://docs.microsoft.com/dotnet/api/system.io.stream) to the clipboard.

| Parameter      | Type                                                          | Description                                                                                  |
| -------------- | ------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
| **audioBytes** | [Byte\[\]](https://docs.microsoft.com/dotnet/api/system.byte) | A [Byte](https://docs.microsoft.com/dotnet/api/system.byte) array containing the audio data. |

**Throws:**

* [ArgumentNullException](https://docs.microsoft.com/dotnet/api/system.argumentnullexception) *audioBytes* is null.

### ![](/files/lIX317sDtMTZJBi9oSIx) SetAudio(audioStream)

Saves the [Stream](https://docs.microsoft.com/dotnet/api/system.io.stream) in the [WaveAudio](/api/wisej.web/enumerations/wisej.web.dataformats.md#fields) format to the clipboard.

| Parameter       | Type                                                             | Description                                                                                   |
| --------------- | ---------------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
| **audioStream** | [Stream](https://docs.microsoft.com/dotnet/api/system.io.stream) | A [Stream](https://docs.microsoft.com/dotnet/api/system.io.stream) containing the audio data. |

**Throws:**

* [ArgumentNullException](https://docs.microsoft.com/dotnet/api/system.argumentnullexception) *audioStream* is null.

### ![](/files/lIX317sDtMTZJBi9oSIx) SetClientText(text)

Saves the text data to the client's temporary clipboard. Client side javascript code can copy the clipboard's content to the browser's clipboard calling Wisej.Core.copy();

| Parameter | Type                                                          | Description                                           |
| --------- | ------------------------------------------------------------- | ----------------------------------------------------- |
| **text**  | [String](https://docs.microsoft.com/dotnet/api/system.string) | The text to save to the client's temporary clipboard. |

**Throws:**

* [ArgumentNullException](https://docs.microsoft.com/dotnet/api/system.argumentnullexception) *text* is null.

### ![](/files/lIX317sDtMTZJBi9oSIx) SetData(format, data)

Saves the specified data to the clipboard in the specified format.

| Parameter  | Type                                                          | Description                                                                                                                    |
| ---------- | ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| **format** | [String](https://docs.microsoft.com/dotnet/api/system.string) | The format of the data to set. See [DataFormats](/api/wisej.web/enumerations/wisej.web.dataformats.md) for predefined formats. |
| **data**   | [Object](https://docs.microsoft.com/dotnet/api/system.object) | An [Object](https://docs.microsoft.com/dotnet/api/system.object) representing the data to add.                                 |

**Throws:**

* [ArgumentNullException](https://docs.microsoft.com/dotnet/api/system.argumentnullexception) *data* is null.

### ![](/files/lIX317sDtMTZJBi9oSIx) SetDataObject(data)

Saves the specified data to the clipboard.

| Parameter | Type                                                          | Description                         |
| --------- | ------------------------------------------------------------- | ----------------------------------- |
| **data**  | [Object](https://docs.microsoft.com/dotnet/api/system.object) | The data to place on the Clipboard. |

**Throws:**

* [ArgumentNullException](https://docs.microsoft.com/dotnet/api/system.argumentnullexception) The value of *data* is null.

### ![](/files/lIX317sDtMTZJBi9oSIx) SetFileDropList(filePaths)

Saves the collection of file names in the [FileDrop](/api/wisej.web/enumerations/wisej.web.dataformats.md#fields) format to the clipboard.

| Parameter     | Type                                                                                                      | Description                                                                                                                            |
| ------------- | --------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| **filePaths** | [StringCollection](https://docs.microsoft.com/dotnet/api/system.collections.specialized.stringcollection) | A [StringCollection](https://docs.microsoft.com/dotnet/api/system.collections.specialized.stringcollection) containing the file names. |

**Throws:**

* [ArgumentNullException](https://docs.microsoft.com/dotnet/api/system.argumentnullexception) *filePaths* is null.
* [ArgumentException](https://docs.microsoft.com/dotnet/api/system.argumentexception) *filePaths* does not contain any strings, or at least one of the strings in *filePaths* is empty, contains only white space, contains one or more invalid characters as defined by [InvalidPathChars](https://docs.microsoft.com/dotnet/api/system.io.path.invalidpathchars), is null, contains a colon (:), or exceeds the system-defined maximum length. See the [InnerException](https://docs.microsoft.com/dotnet/api/system.exception.innerexception) property of the [ArgumentException](https://docs.microsoft.com/dotnet/api/system.argumentexception) for more information.

### ![](/files/lIX317sDtMTZJBi9oSIx) SetImage(image)

Saves the [Image](https://docs.microsoft.com/dotnet/api/system.drawing.image) in the [Bitmap](/api/wisej.web/enumerations/wisej.web.dataformats.md#fields) format to the clipboard

| Parameter | Type                                                                | Description                                                                                      |
| --------- | ------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------ |
| **image** | [Image](https://docs.microsoft.com/dotnet/api/system.drawing.image) | The [Image](https://docs.microsoft.com/dotnet/api/system.drawing.image) to add to the Clipboard. |

**Throws:**

* [ArgumentNullException](https://docs.microsoft.com/dotnet/api/system.argumentnullexception) *image* is null.

### ![](/files/lIX317sDtMTZJBi9oSIx) SetText(text)

Saves the text data in the [UnicodeText](/api/wisej.web/enumerations/wisej.web.textdataformat.md#fields) format to the clipboard.

| Parameter | Type                                                          | Description                       |
| --------- | ------------------------------------------------------------- | --------------------------------- |
| **text**  | [String](https://docs.microsoft.com/dotnet/api/system.string) | The text to add to the Clipboard. |

**Throws:**

* [ArgumentNullException](https://docs.microsoft.com/dotnet/api/system.argumentnullexception) *text* is null or [Empty](https://docs.microsoft.com/dotnet/api/system.string.empty).

### ![](/files/lIX317sDtMTZJBi9oSIx) SetText(text, format)

Saves the text data in the format indicated by the specified [TextDataFormat](/api/wisej.web/enumerations/wisej.web.textdataformat.md) value to the clipboard.

| Parameter  | Type                                                                      | Description                                                                                  |
| ---------- | ------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
| **text**   | [String](https://docs.microsoft.com/dotnet/api/system.string)             | The text to add to the Clipboard.                                                            |
| **format** | [TextDataFormat](/api/wisej.web/enumerations/wisej.web.textdataformat.md) | One of the [TextDataFormat](/api/wisej.web/enumerations/wisej.web.textdataformat.md) values. |

**Throws:**

* [ArgumentNullException](https://docs.microsoft.com/dotnet/api/system.argumentnullexception) *text* is null.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.wisej.com/api/wisej.web/general/wisej.web.clipboard.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
