system.window.form.openfiledialog OpenFileDialog;
openFileDialog=new OpenFileDialog();
openFileDialog.Title="Open file";
if (openFileDialog.ShowDialog() == DialogResult.OK)
{
string file = openFileDialog.FileName; (get the entire file name)
string fileOpenPath, fileName;
int index = file.LastIndexOf("\\"); (get the first starts with a position ending with "\\")
fileOpenPath =file.Substring(0,index); (cut from 0 to the length of "\\")
fileName = file.Substring(index+1,file.Length-index-1); (plus one from index to total length)
}