开发者

Is it possible to read files stored on a computer?

开发者 https://www.devze.com 2023-02-10 08:55 出处:网络
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 .

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

精彩评论

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