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 can i detect if a path is valid.

How can i detect if a path is valid.

Scheduled Pinned Locked Moved C#
question
4 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.
  • S Offline
    S Offline
    Saksida Bojan
    wrote on last edited by
    #1

    I Am Checking with System.IO.Directory.Exsist(), however it will return false either if path doesn't exsist or syntax is incorrect. How can i detect if syntax is correct

    P L 2 Replies Last reply
    0
    • S Saksida Bojan

      I Am Checking with System.IO.Directory.Exsist(), however it will return false either if path doesn't exsist or syntax is incorrect. How can i detect if syntax is correct

      P Offline
      P Offline
      picazo
      wrote on last edited by
      #2

      What do you mean if syntax is incorrect? Can you give an example?

      ----------------- Picazo

      1 Reply Last reply
      0
      • S Saksida Bojan

        I Am Checking with System.IO.Directory.Exsist(), however it will return false either if path doesn't exsist or syntax is incorrect. How can i detect if syntax is correct

        L Offline
        L Offline
        Luc Pattyn
        wrote on last edited by
        #3

        Hi, I haven't tried this yet, however I expect new DirectoryInfo(path) would throw an exception when it doesn't like your path. :)

        Luc Pattyn [Forum Guidelines] [My Articles]


        The quality and detail of your question reflects on the effectiveness of the help you are likely to get. Show formatted code inside PRE tags, and give clear symptoms when describing a problem.


        S 1 Reply Last reply
        0
        • L Luc Pattyn

          Hi, I haven't tried this yet, however I expect new DirectoryInfo(path) would throw an exception when it doesn't like your path. :)

          Luc Pattyn [Forum Guidelines] [My Articles]


          The quality and detail of your question reflects on the effectiveness of the help you are likely to get. Show formatted code inside PRE tags, and give clear symptoms when describing a problem.


          S Offline
          S Offline
          Saksida Bojan
          wrote on last edited by
          #4

          thanks, at least some provblems are solved.

          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