Get the location of a selected file with OpenFileDialog in c #

1

good day I need to get the location of a file selected with OpenFileDialog in c # and put that location in a string variable, I appreciate your help

    
asked by jose marquez 27.10.2016 в 00:25
source

1 answer

1
OpenFileDialog choofdlog = new OpenFileDialog();
choofdlog.Filter = "All Files (*.*)|*.*";
choofdlog.FilterIndex = 1;
choofdlog.Multiselect = true;

if (choofdlog.ShowDialog() == DialogResult.OK)    
{     
    string sFileName = choofdlog.FileName; 
}

Taken from How to get file path from OpenFileDialog and FolderBrowserDialog ?

    
answered by 27.10.2016 / 00:32
source