Re: filenames / extensions with file uploads

From: Eric Lawrence [MSFT] (e_lawrence_at_hotmail.com)
Date: 03/03/04


Date: Tue, 2 Mar 2004 18:30:45 -0800

I believe the File and Directory objects have static methods to parse the
string into its components.

-- 
Thanks,
Eric Lawrence
Program Manager
Assistance and Worldwide Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"Lauchlan M" <LMackinnon@Hotmail.com> wrote in message
news:#rFpQjDAEHA.3184@TK2MSFTNGP09.phx.gbl...
> Hi
>
> I'm doing a file upload and I get
>
>      //get the filename
>      string FullFileNameAndPath = fileDischargeFile.PostedFile.FileName;
>
> This returns the full filepath, eg c:\folder\filename.ext
>
> What I want to do is get the filename (as 'filename.ext') and the
extension
> (as '.ext') from this full path.
>
> What are the best .net methods/namespaces to use for this?
>
> Thanks
>
> Lauchlan M
>
>


Relevant Pages

  • Re: file class
    ... private String _FileName; ... /// filename and all reqired parameters must be set up by user ... public TextFileServer(string FileName, int FixedRecordLen) ... //End of line built from constructor or user manual ...
    (microsoft.public.dotnet.languages.csharp)
  • file class
    ... private String _FileName; ... /// filename and all reqired parameters must be set up by user ... public TextFileServer(string FileName, int FixedRecordLen) ... //End of line built from constructor or user manual ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: file class
    ... private String _FileName; ... /// filename and all reqired parameters must be set up by user ... public TextFileServer(string FileName, int FixedRecordLen) ... //End of line built from constructor or user manual ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: file class
    ... private String _FileName; ... /// filename and all reqired parameters must be set up by user ... public TextFileServer(string FileName, int FixedRecordLen) ... //End of line built from constructor or user manual ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: unbuffered file IO?
    ... private String _FileName; ... /// filename and all reqired parameters must be set up by user ... public TextFileServer(string FileName, int FixedRecordLen) ... //End of line built from constructor or user manual ...
    (microsoft.public.dotnet.languages.csharp)