3

My Question is very simple...I hope.

  1. I want to get the path of app built in Windows Phone 7.
  2. How to Read TEXT File that is placed in BIN folder of the project.

Regards;

Zeeshan Ahmed Khan

1adam12
  • 985
  • 5
  • 13
KhanZeeshan
  • 1,410
  • 5
  • 23
  • 36

1 Answers1

6

You have to use

Application.GetResourceStream(new Uri(_filePath, UriKind.Relative));

where _filePath is the Path to your File without a preceding '/', like "bin/file.txt".

the_Crispy
  • 118
  • 5
  • @KhanZeeshan If this worked for you I'm guessing you set _Build Action_ to _Resource_ for the text file. – Praetorian Jul 19 '11 at 17:17
  • 1
    No I just set Build Action to "Content" – KhanZeeshan Jul 19 '11 at 17:19
  • 1
    Glad I could help. For further information check this MSDN entry: http://msdn.microsoft.com/en-us/library/hh202978(VS.92).aspx In there, they load content from the resource stream and write it into the isolated storage (low half of the entry). – the_Crispy Jul 20 '11 at 08:17