The problem is that you are trying to use FileStream to access a resource embedded in your XAP application file. FileStream used to access the file system (for example, isolated storage).
To access the text file, which is the resource in your XAP file, you can use the following code:
string text; Uri uri = new Uri("("/AssembyName;component/DataMid/Bigram_MidWord.txt", UriKind.RelativeOrAbsolute); StreamResourceInfo sri = App.GetResourceStream(uri); StreamReader sr = new StreamReader(sri.Stream); text= sr.ReadToEnd(); sr.Close();
source share