all groups > dotnet compact framework > december 2006 >
You're in the

dotnet compact framework

group:

FTP over Internet/GPRS Using .NETCF


FTP over Internet/GPRS Using .NETCF troyblakely NO[at]SPAM gmail.com
12/7/2006 4:45:18 PM
dotnet compact framework:
I am trying to set up an application that will send files (pictures) to
a server over an internet connection. My first thought was to use FTP,
but I am up to other suggestions as well. I am using the
OpenNETCF.Net.Ftp class to handle the data transfer. I built my methods
based on the sample in the OpenNETCF vault. It works great through the
emulator or the device over active sync, but it doesn't work over the
wireless internet connection - I get the error message "A socket
operation was attempted to an unreachable host".

So I added the following code to open an internet connection before
doing anything else ftp related.

OpenNETCF.Net.ConnectionManager cm = new ConnectionManager();
cm.Connect(ConnectionMode.Synchronous);

Now I get the message "Couldn't open passive data connection, no
DataConnection IP was given"

Am I missing something?

Should I be going about this in a different way?

Thanks for your help.
Re: FTP over Internet/GPRS Using .NETCF Paul G. Tobey [eMVP]
12/8/2006 8:40:56 AM
Try making the data connection to the Internet manually by running IE and
connecting to the Web or something of that sort. Then run your original code
and see what you get. It's possible that the phone company won't allow you
to have an open socket for incoming connections and, therefore, passive FTP
won't work. You can easily change the mode which the FTP classes in
OpenNETCF are using and try again...

Paul T.

[quoted text, click to view]

AddThis Social Bookmark Button