How to get filename?

  • Thread starter Thread starter Pluto
  • Start date Start date
P

Pluto

Hi,

I can have code like:
Application.ExecutablePath
to return something like "c:\blah\myapp.exe"

I only want "c:\blah\myapp" (or even just "myapp") to return, is there some
other code I can use? Otherwise, I'll have to trim the ".exe".

In the end I want to build a string like "c:\blah\myapp.config".

Thanks.
 
Path.GetFileNameWithoutExtension

or even

Path.ChangeExtension

(they do your work for you!)
 
I must say C# and the available functionality in the .NET framework amazes
me time and time again. I don't know how any of these very
detaillistic/specific issues I've seen being solved by STANDARD solutions!

May I cheer out loud and be happy to embarked on the this C# ship !?
 
Back
Top