Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Accessing network material

  1. Aug 12, 2008 #1
    For a small personal project I was wondering how could I have a program obtain the contents of a folder in a network drive?

    List the filenames in the folder and let us preview the files in a database form format using C#?

    I'd be happy to put in the path name into a field and when the program first opens.

    any help?
  2. jcsd
  3. Aug 23, 2008 #2
    Well if you know XML, you can create a program that uses resource calls to retrieve and store the information needed.

    I haven't used C# before, but it should have a tool that can open sockets between two machines so you can retrieve and pass information.

    Thus, create your program to look any way you decide, but the main points is having an XML file that directs how to handle files from the network drive. You write the XML so your program reads a list of the contents (maybe from an html file located at the server summarizing the contents), and you can program in C# to obtain that information using the instructions from the XML (you should have some stream writing function).

    If you're trying to trying to preview the types of files you have, as in, retrieving the names of the files, you can just create an iteration in your program to search for content, and if null, stop the search, and write the name of the files as strings in your program.

    I would read up on using C# in conjuction with file handling protocols like XML (or even REST). What I just summarized above is what you would need to get it working.
  4. Aug 26, 2008 #3
    Provided that I understand you correctly; there is no difference in how you iterate through local files or files residing on a network folder.

    Either map the network folder to a drive or access the share through a \\server\folder\ path.

    I'm lost as to what "preview files in database form format" means, sorry.

Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook