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. .NET (Core and Framework)
  4. Catching File Not Found Exception VB.net

Catching File Not Found Exception VB.net

Scheduled Pinned Locked Moved .NET (Core and Framework)
csharphelpquestion
2 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.
  • V Offline
    V Offline
    VikashGohil
    wrote on last edited by
    #1

    Hello, I have an Application Where in The Code Reads from a File present in Application Directory. Now if the file is not present, then the code displays the message that File Not Found along with the Full File Path. This is what i don't want, I need only to display File Not Found and not the file path. Could anyone please tell me how can i check what kind of Exception has occured in the catch block and display my own messages as per the exception. Hope I have explained my problem properly, Thanks in Advance.

    A 1 Reply Last reply
    0
    • V VikashGohil

      Hello, I have an Application Where in The Code Reads from a File present in Application Directory. Now if the file is not present, then the code displays the message that File Not Found along with the Full File Path. This is what i don't want, I need only to display File Not Found and not the file path. Could anyone please tell me how can i check what kind of Exception has occured in the catch block and display my own messages as per the exception. Hope I have explained my problem properly, Thanks in Advance.

      A Offline
      A Offline
      Akhilesh Yadav
      wrote on last edited by
      #2

      In C# catch below exception System.IO.FileNotFoundException

      --Akki

      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