---
id: "M:cAlgo.API.OpenFileDialog.#ctor"
kind: "constructor"
type: "T:cAlgo.API.OpenFileDialog"
url: "https://help.ctrader.com/ctrader-algo/references/Dialogs/OpenFileDialog/Constructor/"
---

> Documentation index for agents: https://help.ctrader.com/ctrader-algo/llms.txt · machine index: https://help.ctrader.com/ctrader-algo/api.json

# OpenFileDialog constructor

Member of [OpenFileDialog](https://help.ctrader.com/ctrader-algo/references/Dialogs/OpenFileDialog/index.md).

## OpenFileDialog()

Creates an OpenFileDialog.

Environments: Desktop supported · CLI not supported · Cloud not supported.

- CLI: No dialog can be shown in the CLI: ShowDialog returns FileDialogResult.None and the dialog settings are only stored.
- Cloud: No dialog can be shown in the cloud: ShowDialog returns FileDialogResult.None and the dialog settings are only stored.

C#:

```csharp
public OpenFileDialog()
```

Python:

```python
OpenFileDialog()
```

Available since cAlgo.API 5.1.

### Examples

C#:

```csharp
var openFileDialog = new OpenFileDialog { Title = "Select a CSV file", Filter = "CSV files (*.csv)|*.csv" };
if (openFileDialog.ShowDialog() == FileDialogResult.OK)
    Print("Selected file: {0}", openFileDialog.FileName);
```

Python:

```python
openFileDialog = OpenFileDialog()
openFileDialog.Title = "Select a CSV file"
openFileDialog.Filter = "CSV files (*.csv)|*.csv"
if openFileDialog.ShowDialog() == FileDialogResult.OK:
    api.Print(f"Selected file: {openFileDialog.FileName}")
```

