Extract filename from a filename typed by user

Discussion in 'ASP .Net' started by =?Utf-8?B?Sm9l?=, Aug 23, 2004.

  1. Hi,

    I have a filename abcxyz.doc. Can someone tell me how do I extract the file
    extension .doc from the filename in ASP.NET using VB.

    For your reference a user is typing a filename in the textbox and I am
    trying to parse this text. FileSystemObject is not useful here.

    Thanks,

    joe
     
    =?Utf-8?B?Sm9l?=, Aug 23, 2004
    #1
    1. Advertising

  2. Extension = txtFile.Substring(txtFile.LastIndexOf("."))

    Travis Murray
    MCSD, MCT
    Artiem Consulting, Inc.
    http://www.artiem.com

    "Joe" <> wrote in message
    news:...
    > Hi,
    >
    > I have a filename abcxyz.doc. Can someone tell me how do I extract the

    file
    > extension .doc from the filename in ASP.NET using VB.
    >
    > For your reference a user is typing a filename in the textbox and I am
    > trying to parse this text. FileSystemObject is not useful here.
    >
    > Thanks,
    >
    > joe
    >
    >
     
    Travis Murray, Aug 24, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Scott Reynolds

    Extract filename from url

    Scott Reynolds, Sep 1, 2004, in forum: ASP .Net
    Replies:
    9
    Views:
    11,620
  2. Ersin Gençtürk
    Replies:
    1
    Views:
    3,557
    Ersin Gençtürk
    Oct 6, 2004
  3. Mike
    Replies:
    12
    Views:
    1,200
  4. Yingjie Lan
    Replies:
    4
    Views:
    343
    John Nagle
    Jan 29, 2010
  5. jason
    Replies:
    1
    Views:
    138
    SiteGuru
    Oct 30, 2003
Loading...

Share This Page