How do I implement support for ftp in WP7?

别说谁变了你拦得住时间么 提交于 2019-12-13 14:17:33

问题


Hi
I would like to retrieve documents from an ftp in my Windows phone 7 application (built with XNA in my case).
As far as I understand WP7 does not support ftp due to port and protocol(?) contraints. Is there any way to get ftp support working?
I guess I will be able to implement it my self once socket support is added but I dopn't wan't to wait for that.

Cheers
/Jimmy


回答1:


Since there are no supported socket capabilities in the initial release of WinPhone , you cannot directly FTP. You would have to create an "FTP Proxy" web service which your phone would call and have the service do the actual FTP and relay the files.




回答2:


FTP and Sockets are not supported by the platform at the moment.

If you want to get remote files on to your phone you'll have to use HTTP(S).
You can do this either with the HttpWebRequest or WebClient classes depending on your specific needs.




回答3:


Do you want to retrieve files fromn the phone, and over the cellular network? If so you need to confirm your operator allows ftp connections to your phone, which they probably do not.

If you're connecting over wifi, you've got more chance of this working.

Otherwise, you could implement a dropbox-style approach where the phone and your file-retrieving application both connect to a remote server




回答4:


If this is for development purposes, you can get access to the phones storage and copy in files by using Microsoft's SmartDevices API.




回答5:


I'm trying to do the same but so far the only way I've found around it is to create a web service to run on my own server which retrieves the FTP files on behalf on the phone.

Wish MS would hurry up and give us sockets - calling a web service is fine but I'm pretty sure it would be slower than directly getting the FTP files from the phone itself.



来源:https://stackoverflow.com/questions/4022669/how-do-i-implement-support-for-ftp-in-wp7

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!