FtpWebRequest

Last post 11-25-2008 0:24 by swarna. 0 replies.
Page 1 of 1 (1 items)
Sort Posts: Previous Next
  • 11-25-2008 0:24

    • swarna
    • Not Ranked
    • Joined on 11-21-2008
    • Posts 1

    FtpWebRequest

    Hi all, Im new to this development environment and started to make use of the sample code available in this Forum.

    We are aiming to develop a mobile 5.0 application which should establish a FTP connection from the device. Since FTPWebrequest class is not supported in .Net CF and we came to know about OpenNetCF forum. We downloaded the source code and generated the DLL from the source code.

     

    We are targetting Mobile 5.0 device applications so we created a project with respect to that and included the DLL we generated and copied the sample code from the following link

    http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=89964&SiteID=1

    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");

    else

    testUri = new Uri("192.168.1.9:21");

    // Creating a new FtbRequest object

    request = (FtpWebRequest)WebRequest.Create(testUri);

    request.Credentials = new NetworkCredential("login", "password");

    // Getting the Request stream

    ftpRequestStream = request.GetRequestStream();

    StreamReader reader = new StreamReader(ftpRequestStream);

    ...

    ...

    }

     

    when we tried to compile we get some errors related to the usage of class"FtpWebRequest ", but in the forum its been mentioned that it is working fine. Kindly let us know whether we have missed out someportion so that we could not able to compile the code.

    Early help is needed.

    Thanks

    Swarna

Page 1 of 1 (1 items)