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. File Not Getting Imported (Black Magic)

File Not Getting Imported (Black Magic)

Scheduled Pinned Locked Moved C#
help
5 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.
  • S Offline
    S Offline
    Sandeep Kalra
    wrote on last edited by
    #1

    :confused::confused::confused: Hi All I have two files 1.Application File 2.Import File I have some data to be imported to Application File from import file. When the file to be imported is in the executing directory and i run the application the code is working fine and actually importing the data to the application file. Now the challenge is when the Import File is not in the executing directory.My application do not give any error and also runs fine(i used breakpoints and checked the intermediate values of variables(all were correct)).From intermediate variables i conclude that my application is reading data from the file to be imported correctly.But it is not writing into it.And after closing the application The application file is supposed to have Imported data from the import file.But it donot have any imported data and shows the data of previous state. After that I decided to go for an alternative I decided to copy the import file from another location(say desktop) to executing directory. First I used 1.Fileinfo f = new FileInfo("Fully qualified path of import file"); f.CopyTo(@"tempdata.olf"); 2. i used FileStream code to copy files using Binary reader and binary writer The code works fine and do not throw any runtime errors or exception But the import file is not copied to the tempdata.olf. Note: 1.I have used FullName(fully Qualified Path) of both files 2.The application is working as desired only when both the files are in executing directory. 3.I am running the application in admin account Does anyone has idea what may be wrong. Thanks Regards THE SK

    C 1 Reply Last reply
    0
    • S Sandeep Kalra

      :confused::confused::confused: Hi All I have two files 1.Application File 2.Import File I have some data to be imported to Application File from import file. When the file to be imported is in the executing directory and i run the application the code is working fine and actually importing the data to the application file. Now the challenge is when the Import File is not in the executing directory.My application do not give any error and also runs fine(i used breakpoints and checked the intermediate values of variables(all were correct)).From intermediate variables i conclude that my application is reading data from the file to be imported correctly.But it is not writing into it.And after closing the application The application file is supposed to have Imported data from the import file.But it donot have any imported data and shows the data of previous state. After that I decided to go for an alternative I decided to copy the import file from another location(say desktop) to executing directory. First I used 1.Fileinfo f = new FileInfo("Fully qualified path of import file"); f.CopyTo(@"tempdata.olf"); 2. i used FileStream code to copy files using Binary reader and binary writer The code works fine and do not throw any runtime errors or exception But the import file is not copied to the tempdata.olf. Note: 1.I have used FullName(fully Qualified Path) of both files 2.The application is working as desired only when both the files are in executing directory. 3.I am running the application in admin account Does anyone has idea what may be wrong. Thanks Regards THE SK

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

      Are you using Vista ? Vista creates 'magic folders', if you don't have good security settings, I believe.

      Christian Graus Driven to the arms of OSX by Vista.

      S X 0 3 Replies Last reply
      0
      • C Christian Graus

        Are you using Vista ? Vista creates 'magic folders', if you don't have good security settings, I believe.

        Christian Graus Driven to the arms of OSX by Vista.

        S Offline
        S Offline
        Sandeep Kalra
        wrote on last edited by
        #3

        I am using Windows Xp SP2 Regards THE SK

        1 Reply Last reply
        0
        • C Christian Graus

          Are you using Vista ? Vista creates 'magic folders', if you don't have good security settings, I believe.

          Christian Graus Driven to the arms of OSX by Vista.

          X Offline
          X Offline
          Xmen Real
          wrote on last edited by
          #4

          Christian Graus wrote:

          Vista creates 'magic folders',

          Dude, there is no Magic in computer...

          TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L %^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2 W_AD`EPABIKRDFVS)EVLQK)JKQUFK[M`UKs*$GwU#QDXBER@CBN% R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i’TV.C\y<pŠjxsg-b$f4ia>

          ----------------------------------------------- 128 bit encrypted signature, crack if you can

          1 Reply Last reply
          0
          • C Christian Graus

            Are you using Vista ? Vista creates 'magic folders', if you don't have good security settings, I believe.

            Christian Graus Driven to the arms of OSX by Vista.

            0 Offline
            0 Offline
            0x3c0
            wrote on last edited by
            #5

            Are you referring to soft links?

            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