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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. OpenFileDailogBox

OpenFileDailogBox

Scheduled Pinned Locked Moved C#
6 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.
  • I Offline
    I Offline
    indiaone
    wrote on last edited by
    #1

    Hi, I am trying to open a file that not exit. so want i want if file not there it should create a file with same name. Thanks.

    F C 2 Replies Last reply
    0
    • I indiaone

      Hi, I am trying to open a file that not exit. so want i want if file not there it should create a file with same name. Thanks.

      F Offline
      F Offline
      Flysocket
      wrote on last edited by
      #2

      give a file name to openFileDialog you can confirm if the file exist if not you can create the same name file.

      I want to make some friends here

      I 1 Reply Last reply
      0
      • I indiaone

        Hi, I am trying to open a file that not exit. so want i want if file not there it should create a file with same name. Thanks.

        C Offline
        C Offline
        Christian Graus
        wrote on last edited by
        #3

        System.IO.File.Exists - something like that. If it doesn't exist, create it.

        Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog

        I 1 Reply Last reply
        0
        • C Christian Graus

          System.IO.File.Exists - something like that. If it doesn't exist, create it.

          Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog

          I Offline
          I Offline
          indiaone
          wrote on last edited by
          #4

          Hi, Thanks for reply but i want example on this. Thanks

          C 1 Reply Last reply
          0
          • I indiaone

            Hi, Thanks for reply but i want example on this. Thanks

            C Offline
            C Offline
            Christian Graus
            wrote on last edited by
            #5

            Well, which bit is confusing you ? I can't tell you how to create the file, I don't know why you're creating it, or what you want to put in it.

            Christian Graus - C++ MVP 'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert

            1 Reply Last reply
            0
            • F Flysocket

              give a file name to openFileDialog you can confirm if the file exist if not you can create the same name file.

              I want to make some friends here

              I Offline
              I Offline
              indiaone
              wrote on last edited by
              #6

              Hi. Thanks for your help. I did same and it's working. now what i want.. if folder not exit then how to check. for example: Path C:\XMLFiles\employee.xml if file not exit we can check and create new file with same name but if folder not exit then what to do. how to check and how to create new folder with same name. help me. Thanks

              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