Reading file contents from a file imported into solution RRS feed

  • Question

  • I used to read from and write to files that I created in Solution Explorer back in WinForms days (:P) and was just wondering if this is still possible? I have forgotten how to do it :/ and can't seem to find the right information.


    Could somebody please help rejog my memory, or do you know of any samples, links or docs that would be of assistance?


    Thank you :)

    Friday, December 9, 2011 8:08 AM

All replies

  • I'm moving this to the Tools forum for more assistance.
    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    Monday, December 12, 2011 2:27 PM
  • Can you explain what you're looking for in more detail?  Are you trying to create a data file in the IDE and then read it from your app at runtime?

    If so, then make sure the file is marked as Content and flagged to copy to the output directory.  You can then use the FileStorage functions to read it from Package.Current.InstalledLocation.  The app won't be able to write there, so if you need write access you'll want to write to the app's data store.  See the Application data topic for more information.


    Tuesday, December 13, 2011 5:47 PM