getting Extentionfile ...

  • Thread starter Thread starter genc ymeri
  • Start date Start date
here are 2 different options

-----------------------
string FilePath = "c:\\hello.exe";
// option 1
System.IO.FileInfo fi = new System.IO.FileInfo(FilePath);
this.textBox1.Text = fi.Extension ;
// option 2
this.textBox2.Text = FilePath.Substring(FilePath.LastIndexOf("."));
 
Thanks a lot.....



Bob Boran said:
here are 2 different options

-----------------------
string FilePath = "c:\\hello.exe";
// option 1
System.IO.FileInfo fi = new System.IO.FileInfo(FilePath);
this.textBox1.Text = fi.Extension ;
// option 2
this.textBox2.Text = FilePath.Substring(FilePath.LastIndexOf("."));
 
Back
Top