FtpWebRequest.Method throws ArgumentException! What's wrong?

Last post 07-29-2009 4:21 by Pelle75. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 07-03-2009 5:56

    • ashoot
    • Not Ranked
    • Joined on 07-03-2009
    • Posts 1

    FtpWebRequest.Method throws ArgumentException! What's wrong?

    I am using "opennetcf.net.ftp library" fot get FTP server directory list from .net windows mobile application. I am using the following code:
    1.       FtpRequestCreator creator = new FtpRequestCreator();
    2.       WebRequest.RegisterPrefix("ftp:", creator);
    3.  
    4.       Uri testUri = new Uri("ftp://ftp.ccc.com");
    5.       FtpWebRequest reqFTP = (FtpWebRequest)FtpWebRequest.Create(testUri);
    6.       reqFTP.Credentials = new NetworkCredential("ccc", "ccc123");
    7.       reqFTP.Method = WebRequestMethods.Ftp.ListDirectory;
    But line 7 throws argument exception: "Value does not fall within the expected range". What is wrong? Lib version 2.2.0.0....
  • 07-29-2009 4:21 In reply to

    Re: FtpWebRequest.Method throws ArgumentException! What's wrong?

    I have the same problem, for uploading files, did you finde a solution?

    regards
    pelle75

Page 1 of 1 (2 items)