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. How to Browse , select a file and store it onto the txtbox

How to Browse , select a file and store it onto the txtbox

Scheduled Pinned Locked Moved C#
tutorialquestion
5 Posts 3 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.
  • E Offline
    E Offline
    Eyungwah
    wrote on last edited by
    #1

    Hello everyone: I have a TxtBox with vertibal bar enable and Button. When user click on Button and and browse to select any file, that file would get store on that txtbox. I dont know how to started. Could someone please provide some sample code that I could work with? Thanks, Eyungwa

    R S E 3 Replies Last reply
    0
    • E Eyungwah

      Hello everyone: I have a TxtBox with vertibal bar enable and Button. When user click on Button and and browse to select any file, that file would get store on that txtbox. I dont know how to started. Could someone please provide some sample code that I could work with? Thanks, Eyungwa

      R Offline
      R Offline
      Ravi Bhavnani
      wrote on last edited by
      #2

      Did you not read my reply[^] to your earlier identical post? /ravi

      This is your brain on Celcius Home | Music | Articles | Freeware | Trips ravib(at)ravib(dot)com

      1 Reply Last reply
      0
      • E Eyungwah

        Hello everyone: I have a TxtBox with vertibal bar enable and Button. When user click on Button and and browse to select any file, that file would get store on that txtbox. I dont know how to started. Could someone please provide some sample code that I could work with? Thanks, Eyungwa

        S Offline
        S Offline
        Stefan Troschuetz
        wrote on last edited by
        #3

        To let the user select a file take a look at the FileOpenDialog. An example how to use it is provided by its MSDN topic. How to load the file into a textbox was already answered in your other thread.


        "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook

        www.troschuetz.de

        1 Reply Last reply
        0
        • E Eyungwah

          Hello everyone: I have a TxtBox with vertibal bar enable and Button. When user click on Button and and browse to select any file, that file would get store on that txtbox. I dont know how to started. Could someone please provide some sample code that I could work with? Thanks, Eyungwa

          E Offline
          E Offline
          Eyungwah
          wrote on last edited by
          #4

          Thank you Ravi, tb_Text.Text = File.ReadAllText("C:\\Test"); I got this error saying " The name 'File' doesn't exist in the current context" I like to have txtbox display all the files from C:\Test\ folder and being able to add any file onto that fold as well. -- modified at 16:51 Wednesday 7th February, 2007

          R 1 Reply Last reply
          0
          • E Eyungwah

            Thank you Ravi, tb_Text.Text = File.ReadAllText("C:\\Test"); I got this error saying " The name 'File' doesn't exist in the current context" I like to have txtbox display all the files from C:\Test\ folder and being able to add any file onto that fold as well. -- modified at 16:51 Wednesday 7th February, 2007

            R Offline
            R Offline
            Ravi Bhavnani
            wrote on last edited by
            #5

            You need to add a reference to the System.IO namespace.

            using System.IO;

            /ravi

            This is your brain on Celcius Home | Music | Articles | Freeware | Trips ravib(at)ravib(dot)com

            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