c# - Access To A Resource Text File Within My Application -


i building windows phone 8 application struggling following problem. although can access text files on computer , cannot access text file created in resource folder created in application.

does know how access textfile in folder belongs application ande use streamreader read it?

thank !

you use application.getresourcestream method passing in uri of file, in order access streamresourceinfo object returned, has stream property access (which can pass streamreader , on).

as uri, depends on build action (from properties window) have set file, ie. whether resource or content.

if it's resource, uri should be:

new uri("/assemblyname;component/path/file.txt", urikind.relative); 

if it's content, uri should be:

new uri("path/file.txt", urikind.relative); 

note 'assemblyname' name of assembly project contains file. , 'path' forwardslash-separated path file within project taking account folder , subfolders in.


Comments

Popular posts from this blog

c++ - Creating new partition disk winapi -

Android Prevent Bluetooth Pairing Dialog -

VBA function to include CDATA -