---
id: "P:cAlgo.API.OpenFileDialog.FileName"
kind: "property"
type: "T:cAlgo.API.OpenFileDialog"
url: "https://help.ctrader.com/ctrader-algo/references/Dialogs/OpenFileDialog/FileName/"
---

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

# OpenFileDialog.FileName

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

## FileName

Gets a string containing the full path of the file selected in a file dialog.

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 string FileName {get;}
```

Python:

```python
openFileDialog.FileName: str
```

### Returns

`string` — 

Available since cAlgo.API 5.1.

### Examples

C#:

```csharp
var openFileDialog = new OpenFileDialog { Filter = "Text files (*.txt)|*.txt" };
if (openFileDialog.ShowDialog() == FileDialogResult.OK)
    Print("File: {0}", openFileDialog.FileName);
```

Python:

```python
openFileDialog = OpenFileDialog()
openFileDialog.Filter = "Text files (*.txt)|*.txt"
if openFileDialog.ShowDialog() == FileDialogResult.OK:
    api.Print(f"File: {openFileDialog.FileName}")
```

