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. Web Development
  3. ASP.NET
  4. I want to download file from list box. Could anyone help?

I want to download file from list box. Could anyone help?

Scheduled Pinned Locked Moved ASP.NET
toolshelpquestion
3 Posts 2 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.
  • M Offline
    M Offline
    Member 12016106
    wrote on last edited by
    #1

    string[] file = null;
    int idx;
    protected void Page_Load(object sender, EventArgs e)
    {
    DirectoryInfo dinfo = new DirectoryInfo(@"\\192.168.5.10\fbar\TOOLS\ProbingApps\ProbingSystem\DesktopCopyTemp");
    FileInfo[] Files = dinfo.GetFiles("*.txt");
    foreach (FileInfo file in Files)
    {
    ListBox1.Items.Add(file.Name);
    }

    }

    this is the code which shows files directory, and it display on listbox... Now, I want to download files from list box. I'm not sure with the code. please do help me....Thank You.

    L 1 Reply Last reply
    0
    • M Member 12016106

      string[] file = null;
      int idx;
      protected void Page_Load(object sender, EventArgs e)
      {
      DirectoryInfo dinfo = new DirectoryInfo(@"\\192.168.5.10\fbar\TOOLS\ProbingApps\ProbingSystem\DesktopCopyTemp");
      FileInfo[] Files = dinfo.GetFiles("*.txt");
      foreach (FileInfo file in Files)
      {
      ListBox1.Items.Add(file.Name);
      }

      }

      this is the code which shows files directory, and it display on listbox... Now, I want to download files from list box. I'm not sure with the code. please do help me....Thank You.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      See https://weblog.west-wind.com/posts/2007/May/21/Downloading-a-File-with-a-Save-As-Dialog-in-ASPNET[^].

      M 1 Reply Last reply
      0
      • L Lost User

        See https://weblog.west-wind.com/posts/2007/May/21/Downloading-a-File-with-a-Save-As-Dialog-in-ASPNET[^].

        M Offline
        M Offline
        Member 12016106
        wrote on last edited by
        #3

        Thank You. its really work..

        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