---
id: "T:cAlgo.API.FileDialogResult"
kind: "enum"
namespace: "cAlgo.API"
url: "https://help.ctrader.com/ctrader-algo/references/Dialogs/FileDialogResult/"
---

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

# FileDialogResult (enum)

An enumeration of the different file dialog results.

Environments: Desktop supported · CLI supported · Cloud supported.

## Definition

```csharp
public enum FileDialogResult
```

Available since cAlgo.API 5.1.

## Examples

C#:

```csharp
var openFileDialog = new OpenFileDialog { Title = "Select a CSV file", Filter = "CSV files|*.csv" };
var result = openFileDialog.ShowDialog();

if (result == FileDialogResult.OK)
    Print("Selected file: {0}", openFileDialog.FileName);
else if (result == FileDialogResult.None)
    Print("File dialogs are not supported in this environment");
else
    Print("No file selected: {0}", result);
```

Python:

```python
openFileDialog = OpenFileDialog()
openFileDialog.Title = "Select a CSV file"
openFileDialog.Filter = "CSV files|*.csv"
result = openFileDialog.ShowDialog()

if result == FileDialogResult.OK:
    api.Print(f"Selected file: {openFileDialog.FileName}")
elif result == getattr(FileDialogResult, "None"):
    api.Print("File dialogs are not supported in this environment")
else:
    api.Print(f"No file selected: {result}")
```

## Values

- `FileDialogResult.None` — File dialog is not supported in running environment.
- `FileDialogResult.Cancel` — User closed the dialog.
- `FileDialogResult.OK` — User pressed Ok in dialog.
- `FileDialogResult.Error` — There was an error in file dialog operation.

