how to get file name without the extension?
how to get file name without the extension?
how to get file name without the extension?
how to get file name without the extension?
how to get file name without the extension?
how to get file name without the extension? how to get file name without the extension? how to get file name without the extension? how to get file name without the extension? how to get file name without the extension? how to get file name without the extension? how to get file name without the extension? how to get file name without the extension?
how to get file name without the extension? how to get file name without the extension?
how to get file name without the extension?
Go Back  Xtreme Visual Basic Talk > > > how to get file name without the extension?


Reply
 
Thread Tools Display Modes
  #1  
Old 07-07-2008, 01:11 AM
bellaelysium bellaelysium is offline
Regular
 
Join Date: Jun 2008
Posts: 91
Question how to get file name without the extension?


I have this code where I only want the filename from openfiledialog:

Code:
 Dim FileNameOnly As String = _
System.IO.Path.GetFileName(OpenFileDialog1.FileName)

objExcelC.SeriesCollection(i).XValues = "=" & FileNameOnly & _
"!R2C2:R" & count & "C2"
I was able to get the filename from the path but how do I get the filename without the extension as well?

e.g for now, my code for FileNameOnly is 'animalrack.txt'

I want the FileNameOnly to be 'animalrack' ... without the .txt (extension)

What do I have to add in to filter away the extension?

Thanks!

Last edited by bellaelysium; 07-07-2008 at 01:25 AM.
Reply With Quote
  #2  
Old 07-07-2008, 01:45 AM
bellaelysium bellaelysium is offline
Regular
 
Join Date: Jun 2008
Posts: 91
Default

hi

matter resolved.

Was able to get the filename without extension.

Code:
Dim FileNameOnly As String = _
System.IO.Path.GetFileNameWithoutExtension(OpenFileDialog1.FileName)
Reply With Quote
  #3  
Old 07-07-2008, 12:35 PM
cugone cugone is offline
Centurion
 
Join Date: Nov 2007
Posts: 160
Default

...

Nevermind.

Disregard
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
how to get file name without the extension?
how to get file name without the extension?
how to get file name without the extension? how to get file name without the extension?
how to get file name without the extension?
how to get file name without the extension?
how to get file name without the extension? how to get file name without the extension? how to get file name without the extension? how to get file name without the extension? how to get file name without the extension? how to get file name without the extension? how to get file name without the extension?
how to get file name without the extension?
how to get file name without the extension?
 
how to get file name without the extension?
how to get file name without the extension?
 
-->