trying to FTP a file with a special character

后端 未结 2 2099
情书的邮戳
情书的邮戳 2021-01-18 15:50

I have the code:

FtpWebRequest request = (FtpWebRequest)FtpWebRequest.Create(url);
request.Method = WebRequestMethods.Ftp.DownloadFile;
request.UseBinary = t         


        
2条回答
  •  南方客
    南方客 (楼主)
    2021-01-18 16:20

    Do a string replace with "#" ->"%23"
    URL encodings shouldn't contain a hash because:

    Some characters present the possibility of being misunderstood within URLs for various reasons. These characters should also always be encoded.

提交回复
热议问题