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. To open a new file

To open a new file

Scheduled Pinned Locked Moved C#
tutorial
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.
  • R Offline
    R Offline
    Rupaa
    wrote on last edited by
    #1

    How to open a new File on a Button click such as an Application file.

    M 0 H 3 Replies Last reply
    0
    • R Rupaa

      How to open a new File on a Button click such as an Application file.

      M Offline
      M Offline
      MumbleB
      wrote on last edited by
      #2

      Have you tried to Google[^]for it??

      Excellence is doing ordinary things extraordinarily well.

      1 Reply Last reply
      0
      • R Rupaa

        How to open a new File on a Button click such as an Application file.

        0 Offline
        0 Offline
        0x3c0
        wrote on last edited by
        #3

        Use an OpenFileDialog, then open the file. How you do this depends on which file format it is. If you just want to open it, use Process.Start(fileName)

        Between the idea And the reality Between the motion And the act Falls the Shadow

        1 Reply Last reply
        0
        • R Rupaa

          How to open a new File on a Button click such as an Application file.

          H Offline
          H Offline
          Huxley Stronghead
          wrote on last edited by
          #4

          Rupaa wrote:

          How to open a new File on a Button click such as an Application file.

          To do anything on a button click you will require event processing. If you want to open a file specified by the user, so you need only a file path in string format, you could use OpenFileDialog. If you want to open a file, so actually access it, which would mean you want its information. You can use some .Net's classes inside of the System.IO namespace. They are ending with 'reader'. So what type of file access do you need? If you want just only to execute a certain assembly executable, then I guess Process.Start(fileName) should be fine. ... I hope this helps! :-\

          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