.NET Components for Mobility

WebClient: PASV mode and Upload/Download progress?

Last post 10-06-2008 2:43 AM by jlgarcia. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 10-02-2008 3:18 AM

    WebClient: PASV mode and Upload/Download progress?

    Hi!! I'm developing a Mobile application using the Networking library, and everything is working as expected, using the WebClient class and the FTP protocol. But I have two questions about it:

    Is it possible to enable or disable passive mode in the WebClient class? On the PC side, I've managed to do this by creating a new class, inheriting WebClient, and overriding the function "GetWebRequest", to be able to set the UsePassive property. But on the mobile version I don't know if this is possible, or if there is another way.

    I also would like to know if there is some way to show a progress bar when downloading/uploading a file with the WebClient class. On the PC version, it can be done by using the async versions of those functions, and handling the "UploadProgressChanged" / "DownloadProgressChanged" events. I can't see some equivalent to those on the mobile WebClient. Do I have to use the FTPWebRequest directly to achieve this?

    Thanks in advance :)
  • 10-03-2008 5:56 AM In reply to

    Re: WebClient: PASV mode and Upload/Download progress?

    The WebClient class is modelled on the desktop version and has the same protected GetWebRequest method which you can override. The FtpWebRequest has the UsePassive property like the desktop.

    It doesn't however implement all the Asynchronous functionality in the current version so there is no way to get progress updates. I will add this to the wishlist for the next version.

    Peter

    Peter Foot
    Microsoft Device Application Development MVP
    www.peterfoot.net | www.inthehand.com
  • 10-06-2008 2:43 AM In reply to

    Re: WebClient: PASV mode and Upload/Download progress?

    Thanks for your reply.

    Glad to hear that GetWebRequest can be overriden, just like the desktop version.
    Regarding the async upload/download, I'll be waiting patiently :)

    Thanks!
Page 1 of 1 (3 items)
Copyright © 2001-2008 In The Hand Ltd. All rights reserved. Terms of Use and Privacy Policy.