I want to access a file in computer(c:\test.bin) and to read it as开发者_JAVA技巧 byte array .Is it possible in Windows phone .
Thanks and Regards
vaysage
You cannot access a file via any standard file I/O apis.
You can run a web server on that computer, make the file available via http and include the appropriate client access policy file in the web site. You can then download the file via WebClient
using OpenReadAsync
.
If you would like to upload something as a project asset, then you should force it to be a "content" from the properties panel and then access it using :
Uri uriMyFile = new Uri("test.bin",UriKind.relative);
StreamReader sr = new StreamReader((Application.GetResourcesStream(
uriMyFile)).Stream);
精彩评论