2 Replies - 538 Views - Last Post: 07 February 2013 - 04:10 AM Rate Topic: -----

#1 sethcaudill  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 18-November 07

Question: How to shorten File name

Posted 06 February 2013 - 04:46 PM

I have made a media player with a listbox to add music files, like a playlist, but when I add a file it shows the entire folder/subfolder name with it.. This is the code I have for the add file

If OpenFile1.ShowDialog = Windows.Forms.DialogResult.OK And OpenFile1.FileName <> "" Then
            PlayerControl.URL = OpenFile1.FileName
            DurationTimer.Enabled = True
        End If
        ListBox1.Items.Add(OpenFile1.FileName)



Is This A Good Question/Topic? 0
  • +

Replies To: Question: How to shorten File name

#2 andrewsw  Icon User is online

  • Fire giant boob nipple gun!
  • member icon

Reputation: 3459
  • View blog
  • Posts: 11,717
  • Joined: 12-December 12

Re: Question: How to shorten File name

Posted 06 February 2013 - 05:24 PM

Dim sFile As String = OpenFile1.FileName
MessageBox.Show(System.IO.Path.GetFileNameWithoutExtension(sFile))

Was This Post Helpful? 1
  • +
  • -

#3 sethcaudill  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 18-November 07

Re: Question: How to shorten File name

Posted 07 February 2013 - 04:10 AM

Thanks very much andrewsw that was exactly what I was looking for...
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1