473,323 Members | 1,589 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,323 software developers and data experts.

Reading MP3 FileName?

Hello

I made small mp3 player in VB.NET Express Edition..but i don't know how to
read mp3 filename in Label..for example...i load mp3 by OpenFileDialog..the music starts and filename of that mp3 is shown in Label..

greetings
Apr 5 '07 #1
8 1597
SammyB
807 Expert 512MB
Hello

I made small mp3 player in VB.NET Express Edition..but i don't know how to
read mp3 filename in Label..for example...i load mp3 by OpenFileDialog..the music starts and filename of that mp3 is shown in Label..

greetings
[size=2]Label1.Text = OpenFileDialog1.FileName

[/size]
Apr 6 '07 #2
SammyB
807 Expert 512MB
[size=2]Label1.Text = OpenFileDialog1.FileName

[/size]
Ignore the size stuff. It should be:

Label1.Text = OpenFileDialog1.FileName
Apr 6 '07 #3
channaJ
67
Hello

I made small mp3 player in VB.NET Express Edition..but i don't know how to
read mp3 filename in Label..for example...i load mp3 by OpenFileDialog..the music starts and filename of that mp3 is shown in Label..

greetings
And if you want to take the full path of the file, use..

Expand|Select|Wrap|Line Numbers
  1. Label1.Text = OpenFileDialog.PostedFile.Name;
Apr 6 '07 #4
OK,i will try those...thank you..
Apr 6 '07 #5
@SammyB

I tried to use OpenFileDialog1.FileName,but it returns full path of the file.
i want only filename without full path..i use vb.net express edition with
.NET Framework 2.0..
Apr 15 '07 #6
SammyB
807 Expert 512MB
@SammyB

I tried to use OpenFileDialog1.FileName,but it returns full path of the file.
i want only filename without full path..i use vb.net express edition with
.NET Framework 2.0..
Use FileInfo:
Expand|Select|Wrap|Line Numbers
  1. Dim f As System.IO.FileInfo
  2. f = My.Computer.FileSystem.GetFileInfo (OpenFileDialog1.FileName)
  3. MsgBox(f.Name)
  4. MsgBox(Strings.Replace(f.Name, f.Extension, ""))
Apr 15 '07 #7
I think you can use something like this too:

FileName = PathName.Substring(PathName.LastIndexOf("/") - 1)
Apr 16 '07 #8
Thanks for replying guys...i have found some simple function that do the job.. here it is:

Public Function FileNameWithoutPath(ByVal FullPath As String) As String
Return System.IO.Path.GetFileName(FullPath)
End Function

greets
Apr 18 '07 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

14
by: Erik Andersson | last post by:
Hi! I need to read a file (line-by-line) in reverse order, without reading the whole file into memory first. Is there an easy way of doing this? As in, is there a PHP function I could use? ...
4
by: sashan | last post by:
Is the way to use DOM for an xml file as follows: 1) Read the file into a string 2) Call xml.dom.minidom.parseString(string)
18
by: Michael | last post by:
Hi, I moved to c++ from c, and wanted to know what the best way to read data from files is in c++. Any thoughts? fscanf() is possible but fairly painful! Regards Michael
2
by: JS | last post by:
Hello all! I have come on to a problem for which I am not able to find a solution searching the web. What I am trying to do is reading a log-file with a size of 1.3 GB. When reading it using...
1
by: hzgt9b | last post by:
(FYI, using VB .NET 2003) Can someone help me with this... I'm trying to read in an XML file... it appears to work in that the DataSet ReadXML method dose not fail and then I am able to access the...
12
by: Felix85 | last post by:
here is my method for reading in a file: static room room::file2Room(int rnum){ ostringstream filename; filename << "../gamefiles/rooms/" << rnum << ".room"; ifstream...
8
by: Andrew Robert | last post by:
Hi Everyone. I tried the following to get input into optionparser from either a file or command line. The code below detects the passed file argument and prints the file contents but the...
11
by: Girish Sahani | last post by:
I wrote the following code to concatenate every 2 keys of a dictionary and their corresponding values. e.g if i have tiDict1 = tiDict1 = {'a':,'b':} i should get tiDict2={'ab':} and similarly for...
4
by: Miner Jeff | last post by:
Hello, I have a basic question about reading files. I have several data files where the filenames are identical except for a short (3 character) prefix. I inherited this code and the person who...
0
Guido Geurs
by: Guido Geurs | last post by:
I'm writing a program that list the contents of a CDrom and also the contents of the ZIP files. When there is a bad Zip file on the CD, the program keeps traying to reed the file and after +- 50...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.