小编Afn*_*hir的帖子

我们如何使用FtpWebRequest显示上传进度条

我正在使用上传文件到ftp FtpWebRequest.我需要显示已完成的状态.

到目前为止我的代码是:

public void Upload(string filename, string url)
{
    FileInfo fileInf = new FileInfo(filename);
    string uri = "ftp://" + url + "/" + fileInf.Name;
    FtpWebRequest reqFTP;
    //string uri = "ftp://" + Host + "/public_html/testing/blogtest/" + fileInf.Name;

    // Create FtpWebRequest object from the Uri provided
    reqFTP = (FtpWebRequest)FtpWebRequest.Create(new Uri(uri));

    // Provide the WebPermission Credintials
    reqFTP.Credentials = new NetworkCredential(Username, Password);

    // By default KeepAlive is true, where the control connection is not closed
    // after a command is executed.
    reqFTP.KeepAlive …
Run Code Online (Sandbox Code Playgroud)

c# ftp ftpwebrequest winforms progress-bar

25
推荐指数
2
解决办法
3万
查看次数

标签 统计

c# ×1

ftp ×1

ftpwebrequest ×1

progress-bar ×1

winforms ×1