Results 1 to 2 of 2
  1. #1
    Pixie's Avatar
    Join Date
    Apr 2009
    Gender
    male
    Location
    Pixie wird wieder steigen.
    Posts
    1,884
    Reputation
    22
    Thanks
    229
    My Mood
    Fine

    [HELP]Remove C:\ from C:\Test.txt in filename (Openfiledialog)

    When using a OpenFileDialog, I pick a .txt file to edit it, but when the file filename shows on Label1, it says:
    Code:
    C:\Documents and settings\test.txt
    How do I remove the
    Code:
    C:\Documents and settings\
    so it only says
    Code:
    Test.txt
    ??

  2. #2
    Erinador's Avatar
    Join Date
    Feb 2009
    Gender
    male
    Posts
    224
    Reputation
    14
    Thanks
    111
    My Mood
    Bored
    Easy way:

    If your code is:
    Code:
    Label1.Text = Open.Filename
    Then try this:
    Code:
    Label1.text = Open.SafeFileName.ToString
    Post if you need more help

    Thanks if helped
    Last edited by Erinador; 12-14-2009 at 03:55 PM.

  3. The Following User Says Thank You to Erinador For This Useful Post:

    Pixie (12-14-2009)

Similar Threads

  1. [Help Request] Removing parts from gun models
    By adoramereku in forum Combat Arms Mod Help
    Replies: 7
    Last Post: 09-29-2011, 10:57 PM
  2. [Help]Removing item from listbox [solved]
    By pushdis15 in forum Visual Basic Programming
    Replies: 9
    Last Post: 04-14-2011, 08:47 PM
  3. [help]read text from an online .txt[Solved]
    By trevor206 in forum Visual Basic Programming
    Replies: 10
    Last Post: 09-24-2010, 03:36 PM
  4. [Help]Removing items from ListViewEx? [Solved]
    By Invidus in forum Visual Basic Programming
    Replies: 5
    Last Post: 09-24-2010, 02:57 PM
  5. Replies: 5
    Last Post: 05-30-2010, 10:40 AM