开发者

Is it possible to read files stored on a computer?

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);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜