Is there a way to transfer files from a Pocket PC (Windows Mobile 5.0) to an FTP server I thought FTP functionality was available in system.net.webclient (I read this from another post), but I don't seem to have a webclient class (Compact Framework 2.0).
Any help would be much appreciated.

Compact Framework 2.0 & FTP
Fallen Ghost
http://www.opennetcf.org/library/OpenNETCF.Net.Ftp.html
kumarsv
Litey
Charlie,
Can I ask if you ever got to the bottom of the Ftp.FtpWebRequest.CreateDefault Not Supported problem. I am running Visual Studio 2005 with the OpenNetCF libriaries and get the same problem you experienced.
Many thanks
the user
I downloaded and installed the OpenNETCF stuff (it installed into VS .Net 2003 CF 1.0.500).
I put a ref to the OpenNETCF.Net class (from the older VS install) into my VS 2005 B2 Windows Mobile 5 Pocket PC project and utilized the FtpWebRequest. It compiled and deployed ok, but when I debug it using an emulator it generates a "Not supported Exception".
Am I not referencing it correctly... is it not compatible with the beta rel stuff, or (I'm about a 3-4 on a scale of 1-10 with VB, so I could be doing something basically wrong and not know it)
Here is an example of what I did... (the error is generated from the first line)
Dim wr As FtpWebRequest = FtpWebRequest.CreateDefault(New Uri("ftp://xxx.com/file.txt"))
Dim ts As String = "Some sample text."
Dim enc As New System.Text.ASCIIEncoding
Dim bytes As Byte() = enc.GetBytes(ts)
Dim ns As Stream = wr.GetRequestStream()
wr.ContentLength = bytes.Length()
ns.Write(bytes, 0, bytes.Length())
ns.Close()
Thanks 1E6 for your help.
mshafiq
I had the same problem :"Not supported Exception".
Here, it's the solution to connect on a FTP server from Windows Mobile 5.0 using OpenNETCF: (C#)
using OpenNETCF.Net.Ftp;
using
System.Net;private
static FtpWebRequest request; private static Stream ftpRequestStream;private
static void Connect(){
FtpRequestCreator creator = new FtpRequestCreator(); WebRequest.RegisterPrefix("ftp:", creator); // Building our URI object Uri testUri; if ("192.168.1.9:2121".IndexOf("ftp:") != 0)testUri =
new Uri("ftp://" + "192.168.1.9:21"); elsetestUri =
new Uri("192.168.1.9:21"); // Creating a new FtbRequest objectrequest = (
FtpWebRequest)WebRequest.Create(testUri);request.Credentials =
new NetworkCredential("login", "password"); // Getting the Request streamftpRequestStream = request.GetRequestStream();
StreamReader reader = new StreamReader(ftpRequestStream);...
...
}
If you don't write:
FtpRequestCreator creator = new FtpRequestCreator();
WebRequest.RegisterPrefix("ftp:", creator);
you have the "Not supported Exception" error.
Makler
edtFTPnet/Compact is a port of edtFTPnet, the popular .NET library for embedding full FTP capabilities into .NET applications.
It includes
- a rich interface supporting many FTP commands
- active and passive mode support.
- resuming of binary transfers.
- events for monitoring progress of data transfers.
- compiled for .NET Compact Framework 1.0 and above.
- full source code included.
Seehttp://www.enterprisedt.com/products/edtftpnetcompact/overview.html
for more details.