FileName display

  • Thread starter Thread starter gopal
  • Start date Start date
G

gopal

In the SaveFileDialog window, below we have two combo boxes


1.FileName - which lists all the files with specified extension given
by us
2.Save as Type - which displays type of file extension namely *.txt


1. FileName combo box - shows the complete path of the files namely


C:\Test1\abc.doc
C:\Test1\abc2.doc


What i want is FileName comboBox should only display file names namely
abc.doc
abc2.doc
 
I think you need

string result;
result = Path.GetFileNameWithoutExtension(fileName);

Jon.
 
.....Sorry, silly mistake.

I think its

result = Path.GetFileName(fileName);

Its in the Path class somewhere !

JB
 
I think its

string result;
result = Path.GetFileName(fileName);

Its in the Path class somewhere !

JB
 
Back
Top