Skip to content

OpenFileDialog.FileName

property · OpenFileDialog · cAlgo.API Since 5.1

DesktopCLICloud

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

Environment behaviour

CLI — not supported. No dialog can be shown in the CLI: ShowDialog returns FileDialogResult.None and the dialog settings are only stored.

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

Definition

public string FileName {get;}
openFileDialog.FileName: str

Returns string

Examples

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