• 0

[ASP.NET c#] Local Folder Browsing?


Question

Hi Guys,

Started a major porject at my Work Placement of creating a locally hosted asp.net application. One of the things I decided to do on it is, instead of the user actually typing the folder path into a textbox, I would like the users to just click a browse button and then a tree view type browser appear, and then he/she just points the the directory, so that the details that he/she is working on at the moment can be saved locally.

Beacuse I've only just started to learn asp[vbs] classic about a month ago, let alone asp.net[c#], I'm not that clued up on how to do it? can one of you guys please help me out, and explain the steps and objects i need to use.

thanks matt

Link to comment
https://www.neowin.net/forum/topic/645386-aspnet-c-local-folder-browsing/
Share on other sites

5 answers to this question

Recommended Posts

  • 0

The best place to start would be to look into the DirectoryInfo and FileInfo classes in the System.IO namespace.

They give you the ability to enumerate directories and files, find out meta information etc.

The other thing you need to consider is security on your application, so you will also need to look at things like IIS Security, and ASP.NET Security and how they work together.

  • 0

Saving to a local folder from a browser is a privileged operation, so programmatically scanning a client's drive via a browser isn't something I'd ever recommend(you'd need a client technology like ActiveX to do it anyway, and lower security for that control). What you might do is have the user click a "Save" button that would post their work to the server, which would then put the information into a file format and respond it back to the user prompting them to save it somewhere locally via the typical browser 'File Save' dialog. I do something similar when users want to export datagrids to Excel, so I know it is viable.

  • 0

Ah, I didnt read the 'locally' part. azcodemonkey is correct, you would need to leverage some sort of ActiveX control. I wrote one myself for part of an intranet project to allow me to do drag-drop file uploads from the client browser. If it is an internal (read; Intranet-only) application you are writing, I wouldnt see any issues with deploying your control to client machines.

  • 0

ok so I have a local Folder browser set up in a tree view wich itself is in a panel but the problem im getting now is beacuse i have set the panel to auto add scroll bars every time i click to expand a node that say half way down the scroll it just reset back up to top on postback, is there a way to stop the pane from reseting?

  • 0
  TrickierStinky said:
ok so I have a local Folder browser set up in a tree view wich itself is in a panel but the problem im getting now is beacuse i have set the panel to auto add scroll bars every time i click to expand a node that say half way down the scroll it just reset back up to top on postback, is there a way to stop the pane from reseting?

Use AJAX instead of postback.

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • Running Qbittorrent 5.1.0 on Win11 just fine.
    • I love this game since its first version and it seems that it's only getting better!
    • Oh my goooooooooooooooooooooooooood!!!!!!!!!!!!!!!!!!!!!!!!!!! Yes!!! Super Resident Evil fan here, in case you didn't notice 😅. And Raccoon City is my favorite setting in the entire RE universe. This is a dream come true.
    • Just found this Taskbar Buddy program (still in beta) - 'It lets you turn literally any GIF into your own personal desktop pet.  Thought I would throw some more eyes onto it, (I'm not involved just sharing) https://orange-boy-0.itch.io/taskbar-buddy  
    • Resident Evil Requiem announced for early 2026, taking the story back to Raccoon City by Pulasthi Ariyasinghe The Summer Game Fest showcase today ended with a bang as Capcom delivered the announcement trailer for its next mainline Resident Evil game, finally showing off what it has in store for the ninth entry. Aptly dubbed Resident Evil Requiem, the game is described as a "heart-stopping experience that will chill you to your core." Watch the newly revealed announcement trailer above. The single-player horror game will follow Grace Ashcroft as a protagonist, an FBI agent investigating a series of unusual murders at a hotel named the Remnant Hotel, all linked to her mother's mysterious death. While a new face to the series, she may be related to a character from another Resident Evil game, Outbreak, from back in the day, though Capcom is yet to confirm any ties just yet. Rumors have suggested that Leon is returning in this entry as a playable character too, but the debut trailer did not drop any hints about this project being a dual-protagonist adventure. "A new era of survival horror begins in 2026," says Capcom regarding its latest Resident Evil experience. "Technological advancements combined with the development team's depth of experience combine in a story with rich characters and gameplay that's more immersive than ever before." It looks like the title is returning to its survival horror roots after going for more action-orientated entries in recent times. The original Raccoon City seems to be the setting again too, letting players return to ground zero of the virus outbreak, just in time for the series to hit its 30th anniversary. Resident Evil Requiem is launching across PC, Xbox Series X|S, and PlayStation 5 on February 27, 2026.
  • Recent Achievements

    • Week One Done
      daelos earned a badge
      Week One Done
    • One Month Later
      daelos earned a badge
      One Month Later
    • Mentor
      Karlston went up a rank
      Mentor
    • One Month Later
      EdwardFranciscoVilla earned a badge
      One Month Later
    • One Month Later
      MoyaM earned a badge
      One Month Later
  • Popular Contributors

    1. 1
      +primortal
      492
    2. 2
      snowy owl
      254
    3. 3
      +FloatingFatMan
      252
    4. 4
      ATLien_0
      215
    5. 5
      Xenon
      152
  • Tell a friend

    Love Neowin? Tell a friend!