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. .NET (Core and Framework)
  4. Folder and file view

Folder and file view

Scheduled Pinned Locked Moved .NET (Core and Framework)
csharpquestion
4 Posts 4 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.
  • S Offline
    S Offline
    sb_rs
    wrote on last edited by
    #1

    Hi, I am new to .net and may be this question is very basic..but I did not find much info on standard controls when I browsed. I need to make a small application where the users would select a file for processing. What controls can I use in .net so that the users get a windows explorer like file selector when they click on the button. The file they select should be passed as an argument to some other program. Thanks RS

    S S 2 Replies Last reply
    0
    • S sb_rs

      Hi, I am new to .net and may be this question is very basic..but I did not find much info on standard controls when I browsed. I need to make a small application where the users would select a file for processing. What controls can I use in .net so that the users get a windows explorer like file selector when they click on the button. The file they select should be passed as an argument to some other program. Thanks RS

      S Offline
      S Offline
      Simon P Stevens
      wrote on last edited by
      #2

      You can use the FolderBrowserDialog or OpenFileDialog controls to provide dialogs that allow the user to select a folder/file. Or you can build your own custom one using comboboxes, treeviews and listviews. You'll need to handle the various changed events and populate them all appropriately when the users clicks and changes things. (Tip: You can set the auto complete source on a combo box to "FileSystem" to give a kind of explorer style directory typer box.) Probably easiest to just use the OpenFileDialog though.

      Simon

      1 Reply Last reply
      0
      • S sb_rs

        Hi, I am new to .net and may be this question is very basic..but I did not find much info on standard controls when I browsed. I need to make a small application where the users would select a file for processing. What controls can I use in .net so that the users get a windows explorer like file selector when they click on the button. The file they select should be passed as an argument to some other program. Thanks RS

        S Offline
        S Offline
        ShilpaGinodiya
        wrote on last edited by
        #3

        Hi, You didnot mention which version of .Net are you working on? Anyways, if you are using .net 2.0 you can use fileupload control by which you can select the file same as you select in windows. Just add below code on page_load event. Button1.Attributes.Add("onclick","document.getElementById(' " + FileUpload1.ClientID+ "').click()"); Where button1 is the id of the button you want to open the browser window when being clicked and FileUpload1 is the id of the file upload control. But if you are using .net 1.1 you need to write code explicitely for opening window explorer like file selector. There are some classes defined in framework for that. Hope this will help. :) Cheers Shilpa

        L 1 Reply Last reply
        0
        • S ShilpaGinodiya

          Hi, You didnot mention which version of .Net are you working on? Anyways, if you are using .net 2.0 you can use fileupload control by which you can select the file same as you select in windows. Just add below code on page_load event. Button1.Attributes.Add("onclick","document.getElementById(' " + FileUpload1.ClientID+ "').click()"); Where button1 is the id of the button you want to open the browser window when being clicked and FileUpload1 is the id of the file upload control. But if you are using .net 1.1 you need to write code explicitely for opening window explorer like file selector. There are some classes defined in framework for that. Hope this will help. :) Cheers Shilpa

          L Offline
          L Offline
          Lev Danielyan
          wrote on last edited by
          #4

          Nope, he can't. From the message context it seems he is developing a desktop app, and you are talking Asp.Net ;)

          Regards, Lev

          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