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. Write file to HD and read directly = crach

Write file to HD and read directly = crach

Scheduled Pinned Locked Moved C#
questioncsharp
3 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.
  • O Offline
    O Offline
    Ollie1986
    wrote on last edited by
    #1

    Hey, When I write a file to my Harddisk and try to read (append) the next line (in my code) it craches. He says that the file doesn't exists... But when I wait 3-9sec it exists... How Can I for c# to immediatly write it on my Harddisk and not cache it our something? thx!

    J 1 Reply Last reply
    0
    • O Ollie1986

      Hey, When I write a file to my Harddisk and try to read (append) the next line (in my code) it craches. He says that the file doesn't exists... But when I wait 3-9sec it exists... How Can I for c# to immediatly write it on my Harddisk and not cache it our something? thx!

      J Offline
      J Offline
      joon vh
      wrote on last edited by
      #2

      It's very probably that you forgot to close your file before you tried to open it again. Can you show us the code?


      Visual Studio can't evaluate this, can you? public object moo { __get { return moo; } __set { moo = value; } }

      O 1 Reply Last reply
      0
      • J joon vh

        It's very probably that you forgot to close your file before you tried to open it again. Can you show us the code?


        Visual Studio can't evaluate this, can you? public object moo { __get { return moo; } __set { moo = value; } }

        O Offline
        O Offline
        Ollie1986
        wrote on last edited by
        #3

        Code was inside "Using". Works fine now :) thx!

        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