fileName

  • Thread starter Thread starter Hrcko
  • Start date Start date
H

Hrcko

How to extract file path from fileName?
I'm using OpenFileDialog,but when i read a file I get full path.

Hrcko
 
Look at the static methods of the Path class. You could try
Path.GetDirectoryName. The Path class is in the System.IO namespace.
 
use FileInfo

FileInfo myFile = new FileInfo("the_path_of_file");
string name_of_file = myFile.Name;

byez
 
Back
Top