与Android访问本地网络文件 [英] Access local network files with android

查看:215
本文介绍了与Android访问本地网络文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想通过Android应用程序通过在浏览器中输入\\ pcname \\到我的存取权限LAN上的文件(在NAS或PC)像我可以在Windows上做的。我知道这是可能在Android,因为有其他应用程序,做到这一点(如的 https://play.google.com/store/apps/details?id=com.rhmsoft.fm )。

I want to acces files on my LAN (on a NAS or PC) by an Android app like I can do on Windows by typing \pcname\ in the explorer. I know this is possible on Android, because there are other apps that do this (e.g. https://play.google.com/store/apps/details?id=com.rhmsoft.fm).

我已经尝试访问该文件作为本地文件(新文件(\\\\ pcname \\))。不用说,这没有奏效。我搜索教程网页,但每一个教程中,我发现用FTP,HTTP等。

I already tried accessing the file as a local file (new File("\\pcname\")). Needless to say this did not work. I searched the web for tutorials, but every tutorial I found was using ftp, http and so on.

推荐答案

使用java.net.URL中您可以使用FTP的URL来像的ftp://服务器/路径/要/文​​件。要访问Windows共享,则需要使用Samba协议(还有类似的问题:<一href=\"http://stackoverflow.com/questions/9389366/how-to-access-share-folder-in-windows-through-android-and-read-files\">How通过Android的访问共享文件夹在Windows和读取文件)

Using java.net.URL you can use ftp urls like ftp://servername/path/to/file. To access windows share, you need to use the samba protocol (there is similar question: How to access share folder in windows through android and read files )

这篇关于与Android访问本地网络文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆