简体   繁体   English

使用带有进度条的WININET功能在C#中进行FTP上传/下载

[英]FTP Upload/Download in C# using WININET functions with progress bar

So I found this really nice ftp library that seems to do most of the stuff with WININET functions just fine except one single thing. 因此,我发现了这个非常不错的ftp库 ,该似乎可以完成WININET函数的大部分工作,除了一件事情之外。 It doesn't show progress of uploading/downloading files. 它没有显示上传/下载文件的进度。 Is there an easy way to fix this? 有简单的方法可以解决此问题吗? Or this is like hell to expand it and I would be better off with WebRequest and other libraries (I've seen code examples for progress bar there but this clean and nice library seems to be nice to me so I would prefer to use this one). 或者这就像扩展它一样,我最好使用WebRequest和其他库(我在那里看到了进度栏的代码示例,但是这个干净漂亮的库对我来说似乎很不错,所以我宁愿使用这一库)。

Also if I go with WebRequests or similar will it be as good in terms of speed, scalability etc as using Wininet? 另外,如果我使用WebRequests或类似的产品,那么在速度,可伸缩性等方面与使用Wininet一样好吗?

    public void GetFile(string remoteFile, string localFile, bool failIfExists)
    {
        int ret = WININET.FtpGetFile(_hConnect,
             remoteFile,
             localFile,
             failIfExists,
             WINAPI.FILE_ATTRIBUTE_NORMAL,
             WININET.FTP_TRANSFER_TYPE_BINARY,
             IntPtr.Zero);

        if (ret == 0)
        {
            Error();
        }
    }

也许不能直接回答我的问题,但http://netftp.codeplex.com/可以满足我的所有需求甚至更多。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM