Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. file list

file list

Scheduled Pinned Locked Moved C#
csharpvisual-studiohelptutorialannouncement
13 Posts 6 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kennyhibs
    wrote on last edited by
    #1

    Hi working on my first ever project with c# in visual studio 2008 using net framework 3.5 i'm trying to work out how to display a list of AVI files from a fixed directry (c:\video) and have that list update itself everytime a new file is added and to highlight the latest flle. been looking and trying things out for over 2 weeks and getting no where so any help would be great, even just getting the list of AVI files to display would be a great start thanks kenny

    L A A 3 Replies Last reply
    0
    • K kennyhibs

      Hi working on my first ever project with c# in visual studio 2008 using net framework 3.5 i'm trying to work out how to display a list of AVI files from a fixed directry (c:\video) and have that list update itself everytime a new file is added and to highlight the latest flle. been looking and trying things out for over 2 weeks and getting no where so any help would be great, even just getting the list of AVI files to display would be a great start thanks kenny

      L Offline
      L Offline
      Luc Pattyn
      wrote on last edited by
      #2

      Searching for 2 weeks you must have encountered Directory.GetFiles() and FileSystemWatcher many times, and have become an expert in using them. :)

      Luc Pattyn


      Have a look at my entry for the lean-and-mean competition; please provide comments, feedback, discussion, and don’t forget to vote for it! Thank you.


      Local announcement (Antwerp region): Lange Wapper? Neen!


      K P 2 Replies Last reply
      0
      • K kennyhibs

        Hi working on my first ever project with c# in visual studio 2008 using net framework 3.5 i'm trying to work out how to display a list of AVI files from a fixed directry (c:\video) and have that list update itself everytime a new file is added and to highlight the latest flle. been looking and trying things out for over 2 weeks and getting no where so any help would be great, even just getting the list of AVI files to display would be a great start thanks kenny

        A Offline
        A Offline
        Abhishek Sur
        wrote on last edited by
        #3

        use

        string[] files = Directory.GetFiles("path", "*.avi");

        Path represents the path of the directory, in your case its C:\video :thumbsup:

        Abhishek Sur


        My Latest Articles **Create CLR objects in SQL Server 2005 C# Uncommon Keywords Read/Write Excel using OleDB

        **Don't forget to click "Good Answer" if you like to.

        K 1 Reply Last reply
        0
        • L Luc Pattyn

          Searching for 2 weeks you must have encountered Directory.GetFiles() and FileSystemWatcher many times, and have become an expert in using them. :)

          Luc Pattyn


          Have a look at my entry for the lean-and-mean competition; please provide comments, feedback, discussion, and don’t forget to vote for it! Thank you.


          Local announcement (Antwerp region): Lange Wapper? Neen!


          K Offline
          K Offline
          kennyhibs
          wrote on last edited by
          #4

          yes came across them many times but every time i tried to use them i got errors :-D :-D

          1 Reply Last reply
          0
          • L Luc Pattyn

            Searching for 2 weeks you must have encountered Directory.GetFiles() and FileSystemWatcher many times, and have become an expert in using them. :)

            Luc Pattyn


            Have a look at my entry for the lean-and-mean competition; please provide comments, feedback, discussion, and don’t forget to vote for it! Thank you.


            Local announcement (Antwerp region): Lange Wapper? Neen!


            P Offline
            P Offline
            PIEBALDconsult
            wrote on last edited by
            #5

            That depends on where you search.

            K L 2 Replies Last reply
            0
            • P PIEBALDconsult

              That depends on where you search.

              K Offline
              K Offline
              kennyhibs
              wrote on last edited by
              #6

              Google is a great place however even that doesn't always give you what you want in a format you understand, everyone got to ask to learn kenny

              D 1 Reply Last reply
              0
              • P PIEBALDconsult

                That depends on where you search.

                L Offline
                L Offline
                Luc Pattyn
                wrote on last edited by
                #7

                why, high and low, of course. :)

                Luc Pattyn


                Have a look at my entry for the lean-and-mean competition; please provide comments, feedback, discussion, and don’t forget to vote for it! Thank you.


                Local announcement (Antwerp region): Lange Wapper? Neen!


                1 Reply Last reply
                0
                • A Abhishek Sur

                  use

                  string[] files = Directory.GetFiles("path", "*.avi");

                  Path represents the path of the directory, in your case its C:\video :thumbsup:

                  Abhishek Sur


                  My Latest Articles **Create CLR objects in SQL Server 2005 C# Uncommon Keywords Read/Write Excel using OleDB

                  **Don't forget to click "Good Answer" if you like to.

                  K Offline
                  K Offline
                  kennyhibs
                  wrote on last edited by
                  #8

                  Hi Being very very limited in my knowledge of this could you help me a little further as to what else i need to add to make that bit of code work, assume i'm starting with a blank form! kenny

                  L 1 Reply Last reply
                  0
                  • K kennyhibs

                    Hi Being very very limited in my knowledge of this could you help me a little further as to what else i need to add to make that bit of code work, assume i'm starting with a blank form! kenny

                    L Offline
                    L Offline
                    Luc Pattyn
                    wrote on last edited by
                    #9

                    If you want a personal mentor, you'll have to earn one first. I suggest you start here[^]. :)

                    Luc Pattyn


                    Have a look at my entry for the lean-and-mean competition; please provide comments, feedback, discussion, and don’t forget to vote for it! Thank you.


                    Local announcement (Antwerp region): Lange Wapper? Neen!


                    K 1 Reply Last reply
                    0
                    • L Luc Pattyn

                      If you want a personal mentor, you'll have to earn one first. I suggest you start here[^]. :)

                      Luc Pattyn


                      Have a look at my entry for the lean-and-mean competition; please provide comments, feedback, discussion, and don’t forget to vote for it! Thank you.


                      Local announcement (Antwerp region): Lange Wapper? Neen!


                      K Offline
                      K Offline
                      kennyhibs
                      wrote on last edited by
                      #10

                      Didn't think asking a simple question was such a big deal!

                      L 1 Reply Last reply
                      0
                      • K kennyhibs

                        Google is a great place however even that doesn't always give you what you want in a format you understand, everyone got to ask to learn kenny

                        D Offline
                        D Offline
                        Dave Kreskowiak
                        wrote on last edited by
                        #11

                        Well, you just have to know WHAT to ask of Google and HOW to ask it. This is where the most important skill as a programmer comes into play. It's not the ability to write code or understand the language. It's the ability to do research and teach yourself.

                        A guide to posting questions on CodeProject[^]
                        Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                             2006, 2007, 2008
                        But no longer in 2009...

                        1 Reply Last reply
                        0
                        • K kennyhibs

                          Didn't think asking a simple question was such a big deal!

                          L Offline
                          L Offline
                          Luc Pattyn
                          wrote on last edited by
                          #12

                          The question itself is not a problem, assuming you are willing to learn and make an effort. And if you want to be spoon fed all your life, that is your choice. No big deal except for yourself. :|

                          Luc Pattyn


                          Have a look at my entry for the lean-and-mean competition; please provide comments, feedback, discussion, and don’t forget to vote for it! Thank you.


                          Local announcement (Antwerp region): Lange Wapper? Neen!


                          1 Reply Last reply
                          0
                          • K kennyhibs

                            Hi working on my first ever project with c# in visual studio 2008 using net framework 3.5 i'm trying to work out how to display a list of AVI files from a fixed directry (c:\video) and have that list update itself everytime a new file is added and to highlight the latest flle. been looking and trying things out for over 2 weeks and getting no where so any help would be great, even just getting the list of AVI files to display would be a great start thanks kenny

                            A Offline
                            A Offline
                            April Fans
                            wrote on last edited by
                            #13

                            Very easy. C# 'FileSystemWatcher' object can help you. //for example FileSystemWatcher p = new FileSystemWatcher(@"c:\video"); p.EnableRaisingEvents = true; p.IncludeSubdirectories = true; p.Changed+=new FileSystemEventHandler(p_Changed); p.Created+=new FileSystemEventHandler(p_Created); p.Deleted+=new FileSystemEventHandler(p_Deleted);

                            April Comm100 - Leading Live Chat Software Provider

                            1 Reply Last reply
                            0
                            Reply
                            • Reply as topic
                            Log in to reply
                            • Oldest to Newest
                            • Newest to Oldest
                            • Most Votes


                            • Login

                            • Don't have an account? Register

                            • Login or register to search.
                            • First post
                              Last post
                            0
                            • Categories
                            • Recent
                            • Tags
                            • Popular
                            • World
                            • Users
                            • Groups