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. checking files using c#

checking files using c#

Scheduled Pinned Locked Moved C#
csharphelp
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
    ramyanaidu
    wrote on last edited by
    #1

    plz any one help i need code in c# for checking afile is exisisting if it exists display that file if does not exists create a file in any folder using c# its very urgent if any ine have htis in vb.net also u can give me thanks

    L B P 3 Replies Last reply
    0
    • R ramyanaidu

      plz any one help i need code in c# for checking afile is exisisting if it exists display that file if does not exists create a file in any folder using c# its very urgent if any ine have htis in vb.net also u can give me thanks

      L Offline
      L Offline
      lmoelleb
      wrote on last edited by
      #2

      If you need code, then it's lucky you know how to program isn't it? If not I can send you my consultancy fees - an "urgent" job on a Sunday oh boy oh boy this is going to cost you. Do you have a house you can sell, I'm not quite sure selling the car will do it? :) 1) Look at System.IO.File.Exists (static method), or alternative System.IO.FileInfo.Exists (member method on the FileInfo class) 2) Opening it is not clear enough. Do you want it to open with the standard registered program (so if it is a .doc file start Word) or display the data in your own program. If you want to open with the registered program, look at System.Diagnostics.Process.Start (you can give it a path to the file and it will resolve the correct executable for you). If you need to display it yourself use the System.IO namespace to read file (FileStream/StreamReader/BinaryReader are classes you need to know), then build whatever GUI required on top of the data using whatever you require and are familier with: WinForm, ASP.NET, or WPF.

      1 Reply Last reply
      0
      • R ramyanaidu

        plz any one help i need code in c# for checking afile is exisisting if it exists display that file if does not exists create a file in any folder using c# its very urgent if any ine have htis in vb.net also u can give me thanks

        B Offline
        B Offline
        BAIJUMAX
        wrote on last edited by
        #3

        Check File class under IO . "Well dude, There's Always Better Ways To Do Things. BY BAIJUMAX

        1 Reply Last reply
        0
        • R ramyanaidu

          plz any one help i need code in c# for checking afile is exisisting if it exists display that file if does not exists create a file in any folder using c# its very urgent if any ine have htis in vb.net also u can give me thanks

          P Offline
          P Offline
          Paul Conrad
          wrote on last edited by
          #4

          ramyanaidu wrote:

          its very urgent

          That is a very rude thing to say around here. Your post is a simple one that a quick google search can do for you.

          "Find it your bloody self - immediately!" - Dave Kreskowiak

          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