nicia

nicia

  • NA
  • 10
  • 0

How to retrieve the filename from openfiledialog

Sep 1 2005 12:24 AM

hi, i like to ask if there anyway that i can get the filename from openfiledialog. I just want the filename and not the all pathway. 
Below is the coding i have done.

openFileDialog.showDialog();
textfile = openFileDialog.FileName;

but this will give me the pathway of the file
e.g. (C:\Documents and Settings\Annicia\Desktop\annicia\SQL Server.exe) but i only want the filename (SQL Server.exe). 
If there anyway i can do it as i am quite new to c# can guide me along, thank. 


Answers (2)