How to browse Directory in VB.NET

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Kosal
    New Member
    • Feb 2007
    • 68

    How to browse Directory in VB.NET

    Dear Sir/Madam

    I would like you to help me as below detail.

    - I want to create music list in vb.net and store data in SQL Server, I create form and add gridview in the form and i want to load list of music in gridviev and i want to click music on gridview can play and can browse to destination file, but i don't know how to do, Please help me.

    I waiting to here from you.


    thanks
    Best Regards
    Kosal
  • tlhintoq
    Recognized Expert Specialist
    • Mar 2008
    • 3532

    #2
    Database How two parts 1 and 2

    Comment

    • tlhintoq
      Recognized Expert Specialist
      • Mar 2008
      • 3532

      #3
      Originally posted by Kosal
      I want to create music list in vb.net and store data in SQL Server, I create form and add gridview in the form and i want to load list of music in gridviev and i want to click music on gridview can play and can browse to destination file, but i don't know how to do, Please help me
      I just realized you have like 5 questions all on one post. I'm sorry I only gave you some help on the one.

      So you are really asking:
      1. How do I browse a directory?
      2. How do I put those files in a gridview?
      3. How do I browse to a specific file? ...and...
      4. How do I play the music file I browsed to?

      In short you're asking...
      • Will someone tell me how to build my entire application?


      I admire your "ignore the shallow end, and jump straight into the deep end" attitude. May I suggest that you learn to crawl before you can walk; and walk before you can run?

      Start by learning the simple stuff first.
      • How to use an OpenFileDialog to let the user browse to and select one or more files.
      • How to programatically browse a directory.
      • How to recurssively browse a directory and its subdirectories.
      • How to put those files and folders into a treeview or gridview.
      • How to react to clicks, selections and events of individual rows of a gridview.
      • How to play an mp3 and avi media file.


      Right now don't worry about making every part of it work with your final project of yet another mp3 jukebox program. First learn how to do each part separately. Use the MSDN (a link is in my signature block). Use Google to help with parts. For example: You are not the first person to ask "How do I browse a directory in VB.NET". If you Google "VB.NET browse directory" you will find lots of how-to articles.

      Then... When you understand how all the parts, and bricks and boards and plumbing work.... Then you can design the program to house all the parts.

      Comment

      • Kosal
        New Member
        • Feb 2007
        • 68

        #4
        ok sir thank you for your help,

        I will try to find it,

        Comment

        • Kosal
          New Member
          • Feb 2007
          • 68

          #5
          Hi I still cannot find any solution everyone can help me

          - How do I browse a directory?
          - How do I put those files in a gridview?
          - How do I browse to a specific file? ...and...
          - How do I play the music file I browsed to?

          Comment

          • tlhintoq
            Recognized Expert Specialist
            • Mar 2008
            • 3532

            #6
            Originally posted by Kosal
            Hi I still cannot find any solution everyone can help me

            - How do I browse a directory?
            - How do I put those files in a gridview?
            - How do I browse to a specific file? ...and...
            - How do I play the music file I browsed to?
            Wow! I'm stunned. 3 hours of searching on the internet and you couldn't find one example of any of these?

            My first Google search for "VB.NET play mp3" got me LOTS of examples.

            After checking 2-3 of them I found a 4 line piece of code that claims to do it. I don't code in VB so I can' t confirm it.
            Code:
            # Dim Sound As New System.Media.SoundPlayer() 
            # 
            # Sound.SoundLocation = "your path to the .wav file" 'ex.: c:\mysound.wav 
            # Sound.Load() 
            # Sound.Play()

            Comment

            • Kosal
              New Member
              • Feb 2007
              • 68

              #7
              thanks you for your help.
              I think you can help me anymore

              Comment

              • Plater
                Recognized Expert Expert
                • Apr 2007
                • 7872

                #8
                The common file dailogs will help for browsing files, and should have been in the first results.
                I suspect not a lot of effort was put in

                Comment

                • Kosal
                  New Member
                  • Feb 2007
                  • 68

                  #9
                  can you give me the example for this case

                  thanks

                  Comment

                  • tlhintoq
                    Recognized Expert Specialist
                    • Mar 2008
                    • 3532

                    #10
                    Displays a standard dialog box that prompts the user to open a file. This class cannot be inherited.

                    Comment

                    • Kosal
                      New Member
                      • Feb 2007
                      • 68

                      #11
                      thank you sir
                      let me try

                      Comment

                      • Kosal
                        New Member
                        • Feb 2007
                        • 68

                        #12
                        Hi everyone can help me to give the example as below:

                        How to use an OpenFileDialog to let the user browse to and select one or more files.
                        How to programatically browse a directory.
                        How to recurssively browse a directory and its subdirectories.
                        How to put those files and folders into a treeview or gridview.
                        How to react to clicks, selections and events of individual rows of a gridview.
                        How to play an mp3 and avi media file.

                        Comment

                        • tlhintoq
                          Recognized Expert Specialist
                          • Mar 2008
                          • 3532

                          #13
                          Two weeks between
                          thank you sir, let me try
                          and
                          How to use an OpenFileDialog to let the user browse to and select one or more files.
                          How to programatically browse a directory.
                          How to recurssively browse a directory and its subdirectories.
                          How to put those files and folders into a treeview or gridview.
                          How to react to clicks, selections and events of individual rows of a gridview.
                          How to play an mp3 and avi media file.
                          As near as I can tell in that time you didn't manage to work out a single issue you had. Is that right?
                          You are still asking for help on questions that you received answers to. For example, you are still asking for help on how to use the OpenFileDialog even though you were given a link to the MSDN page with complete code for using this. You are still asking how do you play an MP3 when you have been given code for doing so.

                          With all of the internet at your disposal are you really saying that in 2 weeks you have not manage to use the OpenFileDialog to select a file even after being given this link?
                          Displays a standard dialog box that prompts the user to open a file. This class cannot be inherited.


                          Nobody is going to write all your code for you. You have to make an effort of your own.

                          Comment

                          • !NoItAll
                            Contributor
                            • May 2006
                            • 297

                            #14
                            tlhintoq
                            You are a VERY patient person!
                            I'd like to suggest that posts like this get deleted, and if possible, members put on "probation" (if that is even possible). The reason is that posts like this make a mockery of VB - which is already challenged by the programming community as a "toy language."
                            It ticks me off when half the posts in here are pretty much people asking questions - when they don't appear to even know how to open the IDE.
                            VB.net is a very powerful tool in the right hands. It's also a wonderful language for those who are learning, or need to program at a more basic level - but posts like this are beyond ridiculous. I don't want to be mean, but students looking to get their homework done for them, or people trying to get others to write code for their managers projects just makes my blood boil.
                            What's more - one can search these forums for some good info - and threads like this are just useless noise.
                            Ok - I'm done ranting...

                            Comment

                            Working...