Ivo Pereira Posted October 9, 2009 at 06:08 PM Report Share #290924 Posted October 9, 2009 at 06:08 PM Boas pessoal, aposto que isto é fácil, e aposto que é com a resposta que me vão dar, que eu vou aprender finalmente a trabalhar bem com isto 😞 Imaginem que tenho o nome de um ficheiro incluindo uma pasta: C:\Users\Ivo Pereira\Music\Comercial\Aerosmith - Don't want to miss a thing.mp3 Quero eliminar a primeira parte: C:\Users\Ivo Pereira\Music\Comercial\ e o .mp3. Como fazer ? 😄 Abraço 😄 Link to comment Share on other sites More sharing options...
ribeiro55 Posted October 9, 2009 at 06:15 PM Report Share #290928 Posted October 9, 2009 at 06:15 PM Existem alguns métodos. Vou te dar dois exemplos: Parsing simples: Usas o split por o delimitador "\" e vais buscar o último "rank" da array produzida. Método GetFileInfo da classe FileIO.FileSystem: Devolve-te uma classe devidamente preenchida com tudo o que precisas. Usa a propriedade "Name" Sérgio Ribeiro "Great coders aren't born. They're compiled and released""Expert coders do not need a keyboard. They just throw magnets at the RAM chips" Link to comment Share on other sites More sharing options...
jpaulino Posted October 10, 2009 at 12:00 AM Report Share #290997 Posted October 10, 2009 at 12:00 AM Parsing simples: Usas o split por o delimitador "\" e vais buscar o último "rank" da array produzida. Melhor, usa o método LastIndexOf() para ir buscar a última "\" Link to comment Share on other sites More sharing options...
fLaSh_PT Posted October 13, 2009 at 05:45 PM Report Share #291551 Posted October 13, 2009 at 05:45 PM Melhor ainda: MsgBox( _ System.IO.Path.GetFileNameWithoutExtension("C:\Users\Ivo Pereira\Music\Comercial\Aerosmith - Don't want to miss a thing.mp3") _ ) Compr. Making the impossible possible and pwing the world on db at a time. Link to comment Share on other sites More sharing options...
ribeiro55 Posted October 13, 2009 at 05:51 PM Report Share #291552 Posted October 13, 2009 at 05:51 PM Eh 😛 mesmo à grande. Porreiro. 👍 Sérgio Ribeiro "Great coders aren't born. They're compiled and released""Expert coders do not need a keyboard. They just throw magnets at the RAM chips" Link to comment Share on other sites More sharing options...
Ivo Pereira Posted October 13, 2009 at 11:02 PM Author Report Share #291608 Posted October 13, 2009 at 11:02 PM Melhor ainda: MsgBox( _ System.IO.Path.GetFileNameWithoutExtension("C:\Users\Ivo Pereira\Music\Comercial\Aerosmith - Don't want to miss a thing.mp3") _ ) Compr. Espectáculo 🙂 Obrigado! Tópico resolvido e marcado como tal. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now