|
-
Oct 19th, 2015, 07:41 AM
#1
Thread Starter
Junior Member
File properties
Hi everybody,
I urgently need a small application to do the following:
Take all files in a certain folder.
Take the first 4 characters of the file name (they are all numeric).
Insert this into the #-property of the file.
I have no idea where to start. Can someone please help me?
Jozi
-
Oct 19th, 2015, 09:00 AM
#2
Re: File properties
I understand the first 2 requirements:
 Originally Posted by Jozi68
Take all files in a certain folder.
Take the first 4 characters of the file name (they are all numeric).
That is as simple as this:
Code:
'Loop through each file in a folder
For Each file As IO.FileInfo In New IO.DirectoryInfo("MyDirectory").GetFiles()
'Get the first 4 characters of the file name
Dim number As String = file.Name.Substring(0, 4)
Next
What I don't understand is your last requirement:
 Originally Posted by Jozi68
Insert this into the #-property of the file.
Could you elaborate on that last requirement?
-
Oct 20th, 2015, 12:24 AM
#3
Thread Starter
Junior Member
Re: File properties
The #-Property is mostly used for music (I think), to indicate the order in which mp3 files need to be played.

I hope this helps, I'm not very good at explaining things.
Thank you for your help, I have not coded in about 5 years, so I need to relearn everything.
-
Oct 20th, 2015, 06:58 AM
#4
Re: File properties
I was going to ask the same question as dday9. This is an interesting problem. I found some code samples and tried them and while I can read the properties of an mp3 file I haven't been able to find anything that writes them successfully. However, I'd rather not download anything (like a DLL) I don't really need to do my own work, so maybe some of the sites would be useful to you if you took them further. Also, if I'm able to change the property as a user I shouldn't really need any extra DLL; everything a .net program would need should already be in my PC...
You might have to find out if it's a ID3v1 tag or a ID3v2 tag so you are trying the right code.
So I suggest googling "change # property mp3 vb.net" or something similar. Sorry I can't be of more help. I would've liked to see my code work!
There are 10 kinds of people in this world. Those who understand binary, and those who don't.
-
Oct 20th, 2015, 07:54 AM
#5
Re: File properties
That's an ID3 tag specifically for mp3 files, it's located in the file header, and editing them from .NET is actually fairly difficult. Your best bet is to look for a tutorial by searching for something like "ID3 tags VB .NET". You'll probably get even better results if you search for "ID3 tags C#", but a lot of people don't want to see C#, as if it will give them a rash.
Now, in the Windows App or whatever they call it platform, there's some stuff to manipulate these if I remember right. But you can't use them from a plain old Desktop app.
This answer is wrong. You should be using TableAdapter and Dictionaries instead.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|