How to get filename?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Pluto

    How to get filename?

    Hi,

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

    I only want "c:\blah\my app" (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.


  • Michael A. Covington

    #2
    Re: How to get filename?

    Path.GetFileNam eWithoutExtensi on

    or even

    Path.ChangeExte nsion

    (they do your work for you!)


    "Pluto" <Pluto@Pluto.co m> wrote in message
    news:ebDZUHTjDH A.1668@TK2MSFTN GP12.phx.gbl...[color=blue]
    > Hi,
    >
    > I can have code like:
    > Application.Exe cutablePath
    > to return something like "c:\blah\myapp. exe"
    >
    > I only want "c:\blah\my app" (or even just "myapp") to return, is there[/color]
    some[color=blue]
    > 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.
    >
    >[/color]


    Comment

    • Pluto

      #3
      Re: How to get filename?

      Thanks Michael


      "Michael A. Covington" <look@www.covin gtoninnovations .com.for.addres s> wrote
      in message news:OveklTTjDH A.2300@TK2MSFTN GP10.phx.gbl...[color=blue]
      > Path.GetFileNam eWithoutExtensi on
      >
      > or even
      >
      > Path.ChangeExte nsion
      >
      > (they do your work for you!)
      >
      >
      > "Pluto" <Pluto@Pluto.co m> wrote in message
      > news:ebDZUHTjDH A.1668@TK2MSFTN GP12.phx.gbl...[color=green]
      > > Hi,
      > >
      > > I can have code like:
      > > Application.Exe cutablePath
      > > to return something like "c:\blah\myapp. exe"
      > >
      > > I only want "c:\blah\my app" (or even just "myapp") to return, is there[/color]
      > some[color=green]
      > > 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.
      > >
      > >[/color]
      >
      >[/color]


      Comment

      • Stu Banter

        #4
        Re: How to get filename?

        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 !?

        "Michael A. Covington" <look@www.covin gtoninnovations .com.for.addres s> wrote
        in message news:OveklTTjDH A.2300@TK2MSFTN GP10.phx.gbl...[color=blue]
        > Path.GetFileNam eWithoutExtensi on
        >
        > or even
        >
        > Path.ChangeExte nsion
        >
        > (they do your work for you!)
        >
        >
        > "Pluto" <Pluto@Pluto.co m> wrote in message
        > news:ebDZUHTjDH A.1668@TK2MSFTN GP12.phx.gbl...[color=green]
        > > Hi,
        > >
        > > I can have code like:
        > > Application.Exe cutablePath
        > > to return something like "c:\blah\myapp. exe"
        > >
        > > I only want "c:\blah\my app" (or even just "myapp") to return, is there[/color]
        > some[color=green]
        > > 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.
        > >
        > >[/color]
        >
        >[/color]


        Comment

        • Pluto

          #5
          Re: How to get filename?

          Indeed, the .NET Framework is almost perfect. A great mix of simplicity and
          power.


          "Stu Banter" <x22048spambego ne@westerterp.c om> wrote in message
          news:3f8471bc$0 $58698$e4fe514c @news.xs4all.nl ...[color=blue]
          > 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 !?
          >
          > "Michael A. Covington" <look@www.covin gtoninnovations .com.for.addres s>[/color]
          wrote[color=blue]
          > in message news:OveklTTjDH A.2300@TK2MSFTN GP10.phx.gbl...[color=green]
          > > Path.GetFileNam eWithoutExtensi on
          > >
          > > or even
          > >
          > > Path.ChangeExte nsion
          > >
          > > (they do your work for you!)
          > >
          > >
          > > "Pluto" <Pluto@Pluto.co m> wrote in message
          > > news:ebDZUHTjDH A.1668@TK2MSFTN GP12.phx.gbl...[color=darkred]
          > > > Hi,
          > > >
          > > > I can have code like:
          > > > Application.Exe cutablePath
          > > > to return something like "c:\blah\myapp. exe"
          > > >
          > > > I only want "c:\blah\my app" (or even just "myapp") to return, is there[/color]
          > > some[color=darkred]
          > > > 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.
          > > >
          > > >[/color]
          > >
          > >[/color]
          >
          >[/color]


          Comment

          Working...